aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGDCloud <93287602+GDCloudstrike@users.noreply.github.com>2023-05-09 19:30:24 +0200
committerGitHub <noreply@github.com>2023-05-09 19:30:24 +0200
commitd6c9a7b769e7f8ca5d9d519cb5fb46b046826afd (patch)
tree24b13da7b9334e4401fc3310b7edf34cb3a6e4dc /src/main
parentfff00f6f237541b5d9fd0988cc1941c6eb215441 (diff)
downloadGT5-Unofficial-d6c9a7b769e7f8ca5d9d519cb5fb46b046826afd.tar.gz
GT5-Unofficial-d6c9a7b769e7f8ca5d9d519cb5fb46b046826afd.tar.bz2
GT5-Unofficial-d6c9a7b769e7f8ca5d9d519cb5fb46b046826afd.zip
fix overflow calculations (#204)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
index 1501b692b2..68cdde1801 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java
@@ -753,11 +753,11 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
private void calculateHydrogenHeliumInputExcessValues(final long hydrogenRecipeRequirement,
final long heliumRecipeRequirement) {
- long hydrogenStored = validFluidMap.get(Materials.Hydrogen.getGas(1L));
- long heliumStored = validFluidMap.get(Materials.Helium.getGas(1L));
+ double hydrogenStored = validFluidMap.get(Materials.Hydrogen.getGas(1L));
+ double heliumStored = validFluidMap.get(Materials.Helium.getGas(1L));
- double hydrogenExcessPercentage = abs(1 - hydrogenStored / hydrogenRecipeRequirement);
- double heliumExcessPercentage = abs(1 - heliumStored / heliumRecipeRequirement);
+ double hydrogenExcessPercentage = hydrogenStored / hydrogenRecipeRequirement - 1;
+ double heliumExcessPercentage = heliumStored / heliumRecipeRequirement - 1;
hydrogenOverflowProbabilityAdjustment = 1 - exp(-pow(30 * hydrogenExcessPercentage, 2));
heliumOverflowProbabilityAdjustment = 1 - exp(-pow(30 * heliumExcessPercentage, 2));
@@ -942,7 +942,7 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl
.addInfo(
"Going over a recipe requirement on hydrogen or helium has a penalty on yield and recipe chance.")
.addInfo("All stored hydrogen and helium is consumed during a craft. The associated formulas are:")
- .addInfo(GREEN + "percentageOverflow = abs(1 - fluidStored/recipeRequirement)")
+ .addInfo(GREEN + "percentageOverflow = fluidStored/recipeRequirement - 1")
.addInfo(GREEN + "adjustmentValue = 1 - exp(-(30 * percentageOverflow)^2)")
.addInfo("The value of adjustmentValue is then subtracted from the total yield and recipe chance.")
.addInfo(TOOLTIP_BAR)