aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorHoleFish <48403212+HoleFish@users.noreply.github.com>2024-08-15 02:58:06 +0800
committerGitHub <noreply@github.com>2024-08-14 20:58:06 +0200
commita27c6786958249f6ed54693599900d6ecfb9edaf (patch)
treee8d33f93883f6efe8c4c974e12548123f650cc08 /src/main/java
parenta8536e01d56387a30785c5309e81acaf728ed364 (diff)
downloadGT5-Unofficial-a27c6786958249f6ed54693599900d6ecfb9edaf.tar.gz
GT5-Unofficial-a27c6786958249f6ed54693599900d6ecfb9edaf.tar.bz2
GT5-Unofficial-a27c6786958249f6ed54693599900d6ecfb9edaf.zip
Remove fixEnergyRequirements (#2890)
* Remove fixEnergyRequirements * update * fix * spotless
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java3
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java19
-rw-r--r--src/main/java/gregtech/api/util/GT_RecipeBuilder.java20
3 files changed, 18 insertions, 24 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
index 415b5af36c..30c1276f97 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/MainMod.java
@@ -224,9 +224,6 @@ public final class MainMod {
recipesAdded = true;
}
- StaticRecipeChangeLoaders.fixEnergyRequirements();
- // StaticRecipeChangeLoaders.synchroniseCircuitUseMulti();
-
// Accept recipe map changes into Buffers
RecipeMap.ALL_RECIPE_MAPS.values()
.forEach(
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
index 4271b43303..9d9de87173 100644
--- a/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
+++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/loaders/StaticRecipeChangeLoaders.java
@@ -18,7 +18,6 @@ import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader
import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.NOBLE_GAS;
import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.fluids;
import static com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader.molten;
-import static gregtech.api.enums.GT_Values.VN;
import static gregtech.api.enums.Mods.TinkerConstruct;
import static gregtech.api.enums.TickTime.TICK;
@@ -43,7 +42,6 @@ import com.github.bartimaeusnek.bartworks.API.recipe.DynamicGTRecipe;
import com.github.bartimaeusnek.bartworks.MainMod;
import com.github.bartimaeusnek.bartworks.system.material.Werkstoff;
import com.github.bartimaeusnek.bartworks.util.BW_Util;
-import com.github.bartimaeusnek.bartworks.util.StreamUtils;
import com.github.bartimaeusnek.bartworks.util.log.DebugLog;
import com.github.bartimaeusnek.crossmod.BartWorksCrossmod;
import com.google.common.collect.ArrayListMultimap;
@@ -105,23 +103,6 @@ public class StaticRecipeChangeLoaders {
editRecipes(toChange, getNoGasItems(toChange));
}
- public static void fixEnergyRequirements() {
- RecipeMap.ALL_RECIPE_MAPS.values()
- .stream()
- .filter(StreamUtils::filterVisualMaps)
- .forEach(
- recipeMap -> recipeMap.getAllRecipes()
- .parallelStream()
- .forEach(gt_recipe -> {
- for (int i = 0; i < VN.length - 1; i++) {
- if (gt_recipe.mEUt > BW_Util.getMachineVoltageFromTier(i)
- && gt_recipe.mEUt <= BW_Util.getTierVoltage(i)) {
- gt_recipe.mEUt = BW_Util.getMachineVoltageFromTier(i);
- }
- }
- }));
- }
-
public static void unificationRecipeEnforcer() {
List<GT_Recipe> toRemove = new ArrayList<>();
for (Werkstoff werkstoff : Werkstoff.werkstoffHashSet) {
diff --git a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java
index 66bc11444a..27af090883 100644
--- a/src/main/java/gregtech/api/util/GT_RecipeBuilder.java
+++ b/src/main/java/gregtech/api/util/GT_RecipeBuilder.java
@@ -23,6 +23,7 @@ import net.minecraftforge.fluids.FluidStack;
import org.jetbrains.annotations.Contract;
import gregtech.GT_Mod;
+import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Mods;
import gregtech.api.interfaces.IRecipeMap;
import gregtech.api.recipe.RecipeCategory;
@@ -38,6 +39,7 @@ public class GT_RecipeBuilder {
private static final boolean DEBUG_MODE_NULL;
private static boolean PANIC_MODE_NULL;
private static final boolean DEBUG_MODE_INVALID;
+ private static final boolean DEBUG_MODE_FULL_ENERGY;
private static final boolean PANIC_MODE_INVALID;
private static final boolean DEBUG_MODE_COLLISION;
private static final boolean PANIC_MODE_COLLISION;
@@ -70,6 +72,7 @@ public class GT_RecipeBuilder {
DEBUG_MODE_NULL = debugAll || Boolean.getBoolean("gt.recipebuilder.debug.null");
DEBUG_MODE_INVALID = debugAll || Boolean.getBoolean("gt.recipebuilder.debug.invalid");
DEBUG_MODE_COLLISION = debugAll || Boolean.getBoolean("gt.recipebuilder.debug.collision");
+ DEBUG_MODE_FULL_ENERGY = debugAll || Boolean.getBoolean("gt.recipebuilder.debug.fullenergy");
final boolean panicAll = Boolean.getBoolean("gt.recipebuilder.panic");
PANIC_MODE_NULL = panicAll || Boolean.getBoolean("gt.recipebuilder.panic.null");
@@ -345,13 +348,26 @@ public class GT_RecipeBuilder {
}
public GT_RecipeBuilder eut(int eut) {
+ if (DEBUG_MODE_FULL_ENERGY) {
+ // Ignores ULV voltage
+ for (int i = 1; i < GT_Values.VP.length; i++) {
+ if (eut <= GT_Values.V[i]) {
+ if (eut > GT_Values.VP[i]) {
+ GT_Log.err.println(
+ "EUt > Practical Voltage detected. EUt: " + eut
+ + ", Practical Voltage: "
+ + GT_Values.VP[i]);
+ new IllegalArgumentException().printStackTrace(GT_Log.err);
+ }
+ } else break;
+ }
+ }
this.eut = eut;
return this;
}
public GT_RecipeBuilder eut(long eut) {
- this.eut = (int) eut;
- return this;
+ return eut((int) eut);
}
/**