From a590cdd5e1037a8b6481c5969403a3b2ab888ef4 Mon Sep 17 00:00:00 2001 From: serenibyss <10861407+serenibyss@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:34:56 -0500 Subject: [PATCH 1/7] Add working tier to Material + helper method --- .../api/unification/material/Material.java | 44 +++++++++++++++++++ .../java/gregtech/api/util/GTUtility.java | 37 ++++++++++++++++ .../gregtech/api/util/VoltageScaleTest.java | 43 ++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 src/test/java/gregtech/api/util/VoltageScaleTest.java diff --git a/src/main/java/gregtech/api/unification/material/Material.java b/src/main/java/gregtech/api/unification/material/Material.java index 29c4c9fd9e4..6cb87afd589 100644 --- a/src/main/java/gregtech/api/unification/material/Material.java +++ b/src/main/java/gregtech/api/unification/material/Material.java @@ -1,5 +1,6 @@ package gregtech.api.unification.material; +import gregtech.api.GTValues; import gregtech.api.GregTechAPI; import gregtech.api.fluids.FluidBuilder; import gregtech.api.fluids.FluidState; @@ -369,6 +370,23 @@ public int getBlastTemperature() { return prop == null ? 0 : prop.getBlastTemperature(); } + @ZenGetter("workingTier") + public int getWorkingTier() { + return materialInfo.workingTier; + } + + @ZenMethod + public void setWorkingTier(int workingTier) { + if (workingTier < 0) { + throw new IllegalArgumentException( + "Cannot set working tier for material " + materialInfo.resourceLocation + "to less than 0 (ULV)!"); + } + if (workingTier == GTValues.ULV) { + workingTier = GTValues.LV; + } + materialInfo.workingTier = workingTier; + } + public FluidStack getPlasma(int amount) { return getFluid(FluidStorageKeys.PLASMA, amount); } @@ -1100,6 +1118,25 @@ public Builder addDefaultEnchant(Enchantment enchant, int level) { return this; } + /** + * Sets the tier for "working" recipes to require, such as extruding, bending, etc. + * + * @param tier The tier. Defaults to {@link GTValues#LV} if unset, + * though some recipes may still vary (such as Extruder recipes or Dense Plates). + * Applying ULV is no different from LV. + */ + public Builder workingTier(int tier) { + if (tier < 0) { + throw new IllegalArgumentException( + "Working tier for material" + materialInfo.resourceLocation + "cannot be less than 0 (ULV)!"); + } + if (tier == GTValues.ULV) { + tier = GTValues.LV; + } + materialInfo.workingTier = tier; + return this; + } + public Material build() { materialInfo.componentList = ImmutableList.copyOf(composition); materialInfo.verifyInfo(properties, averageRGB); @@ -1158,6 +1195,13 @@ private static class MaterialInfo { */ private Element element; + /** + * The tier for "working" recipes to require, such as extruding, bending, etc. + *
+ * Default: {@link GTValues#LV}, though some recipes may still vary (such as Dense Plates being MV).
+ */
+ private int workingTier = GTValues.LV;
+
private MaterialInfo(int metaItemSubId, @NotNull ResourceLocation resourceLocation) {
this.metaItemSubId = metaItemSubId;
String name = resourceLocation.getPath();
diff --git a/src/main/java/gregtech/api/util/GTUtility.java b/src/main/java/gregtech/api/util/GTUtility.java
index 39b4a6a0d65..f09ff73cc7a 100644
--- a/src/main/java/gregtech/api/util/GTUtility.java
+++ b/src/main/java/gregtech/api/util/GTUtility.java
@@ -920,4 +920,41 @@ public double getAsDouble() {
public static int safeCastLongToInt(long v) {
return v > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) v;
}
+
+ /**
+ * Scales a proposed recipe voltage according to a provided Material working tier.
+ *
+ * @param voltage The suggested base voltage for the recipe.
+ * @param workingTier The voltage tier ({@link GTValues#V}) to conform this recipe to.
+ *
+ * @return The new recipe voltage.
+ */
+ public static int scaleVoltage(int voltage, int workingTier) {
+ if (workingTier <= GTValues.LV) {
+ // no action needed, as this is the default.
+ return voltage;
+ }
+ if (voltage > GTValues.V[workingTier - 1]) {
+ // no action needed, this recipe is already scaled accordingly.
+ return voltage;
+ }
+
+ // Multiplying very low voltages (less than 16 EU/t) with a formula like below can cause undesirably high
+ // EU/t. For example, 2 EU/t scaled to MV would multiply all the way to 128 EU/t before being above LV voltage.
+ // For this reason, recipes below 16 EU/t simply get set to their tier's VHA[tier] (half voltage adjusted).
+ if (voltage <= 16) {
+ return GTValues.VHA[workingTier];
+ }
+
+ // Instead of blindly increasing the voltage to something like VA[workingTier], try to scale the
+ // voltage up by a "0/4 overclock". The goal here is to retain recipes with EU/t such as 24 staying
+ // below a full amp but still increasing the tier. For instance, 24 EU/t with working tier of MV would become
+ // 96 EU/t rather than 120 EU/t with this logic.
+ while (voltage <= GTValues.V[workingTier - 1]) {
+ voltage *= 4;
+ }
+
+ // Sanity check to make sure we don't accidentally create full-amp recipes.
+ return Math.min(voltage, GTValues.VA[workingTier]);
+ }
}
diff --git a/src/test/java/gregtech/api/util/VoltageScaleTest.java b/src/test/java/gregtech/api/util/VoltageScaleTest.java
new file mode 100644
index 00000000000..d7d84c0350b
--- /dev/null
+++ b/src/test/java/gregtech/api/util/VoltageScaleTest.java
@@ -0,0 +1,43 @@
+package gregtech.api.util;
+
+import gregtech.api.GTValues;
+
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class VoltageScaleTest {
+
+ @Test
+ public void testVoltages() {
+ // Some commonly used numbers for recipe voltages. Ensure none change at LV scaling tier
+ assertEquals(2, GTUtility.scaleVoltage(2, GTValues.LV));
+ assertEquals(4, GTUtility.scaleVoltage(4, GTValues.LV));
+ assertEquals(7, GTUtility.scaleVoltage(7, GTValues.LV));
+ assertEquals(8, GTUtility.scaleVoltage(8, GTValues.LV));
+ assertEquals(16, GTUtility.scaleVoltage(16, GTValues.LV));
+ assertEquals(24, GTUtility.scaleVoltage(24, GTValues.LV));
+ assertEquals(30, GTUtility.scaleVoltage(30, GTValues.LV));
+ // Also test that voltages above are not affected.
+ assertEquals(120, GTUtility.scaleVoltage(120, GTValues.LV));
+
+ // Test to make sure they scale to above LV, with the appropriate scaled voltage
+ // The first few are capped at half voltage.
+ assertEquals(GTValues.VHA[GTValues.MV], GTUtility.scaleVoltage(2, GTValues.MV));
+ assertEquals(GTValues.VHA[GTValues.MV], GTUtility.scaleVoltage(4, GTValues.MV));
+ assertEquals(GTValues.VHA[GTValues.MV], GTUtility.scaleVoltage(7, GTValues.MV));
+ assertEquals(GTValues.VHA[GTValues.MV], GTUtility.scaleVoltage(8, GTValues.MV));
+ assertEquals(GTValues.VHA[GTValues.MV], GTUtility.scaleVoltage(16, GTValues.MV));
+ // The remaining should scale depending on their actual voltage
+ assertEquals(96, GTUtility.scaleVoltage(24, GTValues.MV));
+ assertEquals(120, GTUtility.scaleVoltage(30, GTValues.MV));
+ // Ensure a recipe will not exceed VA, even if the provided value "should" scale higher
+ assertEquals(120, GTUtility.scaleVoltage(32, GTValues.MV));
+ // Test that voltages already at MV are unaffected.
+ assertEquals(33, GTUtility.scaleVoltage(33, GTValues.MV));
+ assertEquals(120, GTUtility.scaleVoltage(120, GTValues.MV));
+ // Also test that voltages above are still unaffected.
+ assertEquals(129, GTUtility.scaleVoltage(129, GTValues.MV));
+ assertEquals(480, GTUtility.scaleVoltage(480, GTValues.MV));
+ }
+}
From d78fdf6827865b9fff94dec5c43d6c3369649e1f Mon Sep 17 00:00:00 2001
From: serenibyss <10861407+serenibyss@users.noreply.github.com>
Date: Wed, 27 Mar 2024 02:02:47 -0500
Subject: [PATCH 2/7] Add working tier checks to all processing handlers
---
.../handlers/MaterialRecipeHandler.java | 91 ++++---
.../recipe/handlers/PartsRecipeHandler.java | 233 +++++++++++-------
.../recipe/handlers/PipeRecipeHandler.java | 95 ++++---
.../recipe/handlers/ToolRecipeHandler.java | 3 +-
.../recipe/handlers/WireRecipeHandler.java | 9 +-
5 files changed, 273 insertions(+), 158 deletions(-)
diff --git a/src/main/java/gregtech/loaders/recipe/handlers/MaterialRecipeHandler.java b/src/main/java/gregtech/loaders/recipe/handlers/MaterialRecipeHandler.java
index 3b048b093c6..3e36c20ff46 100644
--- a/src/main/java/gregtech/loaders/recipe/handlers/MaterialRecipeHandler.java
+++ b/src/main/java/gregtech/loaders/recipe/handlers/MaterialRecipeHandler.java
@@ -279,6 +279,8 @@ public static void processTinyDust(OrePrefix orePrefix, Material material, DustP
}
public static void processIngot(OrePrefix ingotPrefix, Material material, IngotProperty property) {
+ int workingTier = material.getWorkingTier();
+
if (material.hasFlag(MORTAR_GRINDABLE)) {
ModHandler.addShapedRecipe(String.format("mortar_grind_%s", material),
OreDictUnifier.get(OrePrefix.dust, material), "X", "m", 'X',
@@ -286,17 +288,20 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
}
if (material.hasFlag(GENERATE_ROD)) {
- ModHandler.addShapedRecipe(String.format("stick_%s", material),
- OreDictUnifier.get(OrePrefix.stick, material, 1),
- "f ", " X",
- 'X', new UnificationEntry(ingotPrefix, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("stick_%s", material),
+ OreDictUnifier.get(OrePrefix.stick, material, 1),
+ "f ", " X",
+ 'X', new UnificationEntry(ingotPrefix, material));
+ }
+
if (!material.hasFlag(NO_WORKING)) {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
.input(ingotPrefix, material)
.notConsumable(MetaItems.SHAPE_EXTRUDER_ROD)
.outputs(OreDictUnifier.get(OrePrefix.stick, material, 2))
.duration((int) material.getMass() * 2)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
}
@@ -306,7 +311,8 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_MOLD_INGOT)
.fluidInputs(material.getProperty(PropertyKey.FLUID).solidifiesFrom(L))
.outputs(OreDictUnifier.get(ingotPrefix, material))
- .duration(20).EUt(VA[ULV])
+ .duration(20)
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
@@ -316,26 +322,32 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_EXTRUDER_INGOT)
.outputs(OreDictUnifier.get(OrePrefix.ingot, material))
.duration(10)
- .EUt(4 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(4 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
- ALLOY_SMELTER_RECIPES.recipeBuilder().EUt(VA[ULV]).duration((int) material.getMass())
+ ALLOY_SMELTER_RECIPES.recipeBuilder()
.input(ingot, material)
.notConsumable(MetaItems.SHAPE_MOLD_NUGGET.getStackForm())
.output(nugget, material, 9)
+ .duration((int) material.getMass())
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
if (!OreDictUnifier.get(block, material).isEmpty()) {
- ALLOY_SMELTER_RECIPES.recipeBuilder().EUt(VA[ULV]).duration((int) material.getMass() * 9)
+ ALLOY_SMELTER_RECIPES.recipeBuilder()
.input(block, material)
.notConsumable(MetaItems.SHAPE_MOLD_INGOT.getStackForm())
.output(ingot, material, 9)
+ .duration((int) material.getMass() * 9)
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
- COMPRESSOR_RECIPES.recipeBuilder().EUt(2).duration(300)
+ COMPRESSOR_RECIPES.recipeBuilder()
.input(ingot, material, (int) (block.getMaterialAmount(material) / M))
.output(block, material)
+ .duration(300)
+ .EUt(GTUtility.scaleVoltage(2, workingTier))
.buildAndRegister();
}
@@ -348,17 +360,21 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
.circuitMeta(1)
.input(ingotPrefix, material)
.outputs(plateStack)
- .EUt(24).duration((int) (material.getMass()))
+ .duration((int) (material.getMass()))
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.buildAndRegister();
RecipeMaps.FORGE_HAMMER_RECIPES.recipeBuilder()
.input(ingotPrefix, material, 3)
.outputs(GTUtility.copy(2, plateStack))
- .EUt(16).duration((int) material.getMass())
+ .duration((int) material.getMass())
+ .EUt(GTUtility.scaleVoltage(16, workingTier))
.buildAndRegister();
- ModHandler.addShapedRecipe(String.format("plate_%s", material),
- plateStack, "h", "I", "I", 'I', new UnificationEntry(ingotPrefix, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("plate_%s", material),
+ plateStack, "h", "I", "I", 'I', new UnificationEntry(ingotPrefix, material));
+ }
}
}
@@ -369,7 +385,7 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_EXTRUDER_PLATE)
.outputs(OreDictUnifier.get(OrePrefix.plate, material))
.duration((int) material.getMass())
- .EUt(8 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -378,7 +394,7 @@ public static void processIngot(OrePrefix ingotPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_EXTRUDER_PLATE)
.outputs(OreDictUnifier.get(OrePrefix.plate, material))
.duration((int) material.getMass())
- .EUt(8 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, workingTier))
.buildAndRegister();
}
}
@@ -418,10 +434,12 @@ public static void processGemConversion(OrePrefix gemPrefix, @Nullable OrePrefix
public static void processNugget(OrePrefix orePrefix, Material material, DustProperty property) {
ItemStack nuggetStack = OreDictUnifier.get(orePrefix, material);
+ int workingTier = material.getWorkingTier();
+
if (material.hasProperty(PropertyKey.INGOT)) {
ItemStack ingotStack = OreDictUnifier.get(OrePrefix.ingot, material);
- if (!ConfigHolder.recipes.disableManualCompression) {
+ if (!ConfigHolder.recipes.disableManualCompression && workingTier <= HV) {
ModHandler.addShapelessRecipe(String.format("nugget_disassembling_%s", material),
GTUtility.copy(9, nuggetStack), new UnificationEntry(OrePrefix.ingot, material));
ModHandler.addShapedRecipe(String.format("nugget_assembling_%s", material),
@@ -431,12 +449,16 @@ public static void processNugget(OrePrefix orePrefix, Material material, DustPro
COMPRESSOR_RECIPES.recipeBuilder()
.input(nugget, material, 9)
.output(ingot, material)
- .EUt(2).duration(300).buildAndRegister();
+ .duration(300)
+ .EUt(GTUtility.scaleVoltage(2, workingTier))
+ .buildAndRegister();
- ALLOY_SMELTER_RECIPES.recipeBuilder().EUt(VA[ULV]).duration((int) material.getMass())
+ ALLOY_SMELTER_RECIPES.recipeBuilder()
.input(nugget, material, 9)
.notConsumable(MetaItems.SHAPE_MOLD_INGOT.getStackForm())
.output(ingot, material)
+ .duration((int) material.getMass())
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
if (material.hasFluid() && material.getProperty(PropertyKey.FLUID).solidifiesFrom() != null) {
@@ -445,13 +467,12 @@ public static void processNugget(OrePrefix orePrefix, Material material, DustPro
.fluidInputs(material.getProperty(PropertyKey.FLUID).solidifiesFrom(L))
.outputs(OreDictUnifier.get(orePrefix, material, 9))
.duration((int) material.getMass())
- .EUt(VA[ULV])
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
} else if (material.hasProperty(PropertyKey.GEM)) {
- ItemStack gemStack = OreDictUnifier.get(OrePrefix.gem, material);
-
- if (!ConfigHolder.recipes.disableManualCompression) {
+ if (!ConfigHolder.recipes.disableManualCompression && workingTier <= HV) {
+ ItemStack gemStack = OreDictUnifier.get(OrePrefix.gem, material);
ModHandler.addShapelessRecipe(String.format("nugget_disassembling_%s", material),
GTUtility.copy(9, nuggetStack), new UnificationEntry(OrePrefix.gem, material));
ModHandler.addShapedRecipe(String.format("nugget_assembling_%s", material),
@@ -480,13 +501,16 @@ public static void processFrame(OrePrefix framePrefix, Material material, DustPr
public static void processBlock(OrePrefix blockPrefix, Material material, DustProperty property) {
ItemStack blockStack = OreDictUnifier.get(blockPrefix, material);
long materialAmount = blockPrefix.getMaterialAmount(material);
+ int workingTier = material.getWorkingTier();
+
if (material.hasFluid() && material.getProperty(PropertyKey.FLUID).solidifiesFrom() != null) {
RecipeMaps.FLUID_SOLIDFICATION_RECIPES.recipeBuilder()
.notConsumable(MetaItems.SHAPE_MOLD_BLOCK)
.fluidInputs(material.getProperty(PropertyKey.FLUID).solidifiesFrom(
((int) (materialAmount * L / M))))
.outputs(blockStack)
- .duration((int) material.getMass()).EUt(VA[ULV])
+ .duration((int) material.getMass())
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
@@ -496,7 +520,8 @@ public static void processBlock(OrePrefix blockPrefix, Material material, DustPr
RecipeMaps.CUTTER_RECIPES.recipeBuilder()
.input(blockPrefix, material)
.outputs(GTUtility.copy((int) (materialAmount / M), plateStack))
- .duration((int) (material.getMass() * 8L)).EUt(VA[LV])
+ .duration((int) (material.getMass() * 8L))
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
}
}
@@ -520,7 +545,7 @@ public static void processBlock(OrePrefix blockPrefix, Material material, DustPr
// do not allow hand crafting or uncrafting of blacklisted blocks
if (!material.hasFlag(EXCLUDE_BLOCK_CRAFTING_BY_HAND_RECIPES) &&
- !ConfigHolder.recipes.disableManualCompression) {
+ !ConfigHolder.recipes.disableManualCompression && workingTier <= HV) {
ModHandler.addShapelessRecipe(String.format("block_compress_%s", material), blockStack,
result.toArray());
@@ -535,25 +560,31 @@ public static void processBlock(OrePrefix blockPrefix, Material material, DustPr
.input(OrePrefix.ingot, material, (int) (materialAmount / M))
.notConsumable(MetaItems.SHAPE_EXTRUDER_BLOCK)
.outputs(blockStack)
- .duration(10).EUt(8 * voltageMultiplier)
+ .duration(10)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, workingTier))
.buildAndRegister();
RecipeMaps.ALLOY_SMELTER_RECIPES.recipeBuilder()
.input(OrePrefix.ingot, material, (int) (materialAmount / M))
.notConsumable(MetaItems.SHAPE_MOLD_BLOCK)
.outputs(blockStack)
- .duration(5).EUt(4 * voltageMultiplier)
+ .duration(5)
+ .EUt(GTUtility.scaleVoltage(4 * voltageMultiplier, workingTier))
.buildAndRegister();
} else if (material.hasProperty(PropertyKey.GEM)) {
COMPRESSOR_RECIPES.recipeBuilder()
.input(gem, material, (int) (block.getMaterialAmount(material) / M))
.output(block, material)
- .duration(300).EUt(2).buildAndRegister();
+ .duration(300)
+ .EUt(GTUtility.scaleVoltage(2, workingTier))
+ .buildAndRegister();
FORGE_HAMMER_RECIPES.recipeBuilder()
.input(block, material)
.output(gem, material, (int) (block.getMaterialAmount(material) / M))
- .duration(100).EUt(24).buildAndRegister();
+ .duration(100)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
+ .buildAndRegister();
}
}
}
diff --git a/src/main/java/gregtech/loaders/recipe/handlers/PartsRecipeHandler.java b/src/main/java/gregtech/loaders/recipe/handlers/PartsRecipeHandler.java
index ddff63fd34a..969679c0418 100644
--- a/src/main/java/gregtech/loaders/recipe/handlers/PartsRecipeHandler.java
+++ b/src/main/java/gregtech/loaders/recipe/handlers/PartsRecipeHandler.java
@@ -59,12 +59,13 @@ public static void register() {
public static void processBolt(OrePrefix boltPrefix, Material material, DustProperty property) {
ItemStack boltStack = OreDictUnifier.get(boltPrefix, material);
ItemStack ingotStack = OreDictUnifier.get(OrePrefix.ingot, material);
+ int workingTier = material.getWorkingTier();
RecipeMaps.CUTTER_RECIPES.recipeBuilder()
.input(OrePrefix.screw, material)
.outputs(boltStack)
.duration(20)
- .EUt(24)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.buildAndRegister();
if (!boltStack.isEmpty() && !ingotStack.isEmpty()) {
@@ -73,7 +74,7 @@ public static void processBolt(OrePrefix boltPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_EXTRUDER_BOLT)
.outputs(GTUtility.copy(8, boltStack))
.duration(15)
- .EUt(VA[MV])
+ .EUt(GTUtility.scaleVoltage(VA[MV], workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -82,7 +83,7 @@ public static void processBolt(OrePrefix boltPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_EXTRUDER_BOLT)
.outputs(GTUtility.copy(8, boltStack))
.duration(15)
- .EUt(VA[MV])
+ .EUt(GTUtility.scaleVoltage(VA[MV], workingTier))
.buildAndRegister();
}
}
@@ -90,30 +91,36 @@ public static void processBolt(OrePrefix boltPrefix, Material material, DustProp
public static void processScrew(OrePrefix screwPrefix, Material material, DustProperty property) {
ItemStack screwStack = OreDictUnifier.get(screwPrefix, material);
+ int workingTier = material.getWorkingTier();
RecipeMaps.LATHE_RECIPES.recipeBuilder()
.input(OrePrefix.bolt, material)
.outputs(screwStack)
.duration((int) Math.max(1, material.getMass() / 8L))
- .EUt(4)
+ .EUt(GTUtility.scaleVoltage(4, workingTier))
.buildAndRegister();
- ModHandler.addShapedRecipe(String.format("screw_%s", material),
- screwStack, "fX", "X ",
- 'X', new UnificationEntry(OrePrefix.bolt, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("screw_%s", material),
+ screwStack, "fX", "X ",
+ 'X', new UnificationEntry(OrePrefix.bolt, material));
+ }
}
public static void processFoil(OrePrefix foilPrefix, Material material, IngotProperty property) {
- if (!material.hasFlag(NO_SMASHING))
+ int workingTier = material.getWorkingTier();
+
+ if (!material.hasFlag(NO_SMASHING) && workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("foil_%s", material),
OreDictUnifier.get(foilPrefix, material, 2),
"hP ", 'P', new UnificationEntry(plate, material));
+ }
RecipeMaps.BENDER_RECIPES.recipeBuilder()
.input(plate, material)
.output(foilPrefix, material, 4)
.duration((int) material.getMass())
- .EUt(24)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.circuitMeta(1)
.buildAndRegister();
@@ -121,7 +128,7 @@ public static void processFoil(OrePrefix foilPrefix, Material material, IngotPro
.input(ingot, material)
.output(foilPrefix, material, 4)
.duration((int) material.getMass())
- .EUt(24)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.circuitMeta(10)
.buildAndRegister();
@@ -131,7 +138,7 @@ public static void processFoil(OrePrefix foilPrefix, Material material, IngotPro
.notConsumable(MetaItems.SHAPE_EXTRUDER_FOIL)
.output(foilPrefix, material, 4)
.duration((int) material.getMass())
- .EUt(24)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.buildAndRegister();
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
@@ -139,13 +146,15 @@ public static void processFoil(OrePrefix foilPrefix, Material material, IngotPro
.notConsumable(MetaItems.SHAPE_EXTRUDER_FOIL)
.output(foilPrefix, material, 4)
.duration((int) material.getMass())
- .EUt(24)
+ .EUt(GTUtility.scaleVoltage(24, workingTier))
.buildAndRegister();
}
}
public static void processFineWire(OrePrefix fineWirePrefix, Material material, IngotProperty property) {
- if (!OreDictUnifier.get(foil, material).isEmpty())
+ int workingTier = material.getWorkingTier();
+
+ if (!OreDictUnifier.get(foil, material).isEmpty() && workingTier <= HV)
ModHandler.addShapelessRecipe(String.format("fine_wire_%s", material.toString()),
OreDictUnifier.get(fineWirePrefix, material),
'x', new UnificationEntry(OrePrefix.foil, material));
@@ -156,7 +165,7 @@ public static void processFineWire(OrePrefix fineWirePrefix, Material material,
.circuitMeta(1)
.output(fineWirePrefix, material, 4)
.duration((int) material.getMass() * 3 / 2)
- .EUt(VA[ULV])
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
@@ -165,11 +174,13 @@ public static void processFineWire(OrePrefix fineWirePrefix, Material material,
.circuitMeta(3)
.output(fineWirePrefix, material, 8)
.duration((int) material.getMass() * 2)
- .EUt(VA[ULV])
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
public static void processGear(OrePrefix gearPrefix, Material material, DustProperty property) {
+ int workingTier = material.getWorkingTier();
+
ItemStack stack = OreDictUnifier.get(gearPrefix, material);
if (gearPrefix == OrePrefix.gear && material.hasProperty(PropertyKey.INGOT)) {
int voltageMultiplier = getVoltageMultiplier(material);
@@ -178,7 +189,7 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_EXTRUDER_GEAR)
.outputs(OreDictUnifier.get(gearPrefix, material))
.duration((int) material.getMass() * 5)
- .EUt(8 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, workingTier))
.buildAndRegister();
RecipeMaps.ALLOY_SMELTER_RECIPES.recipeBuilder()
@@ -186,7 +197,7 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_MOLD_GEAR)
.outputs(OreDictUnifier.get(gearPrefix, material))
.duration((int) material.getMass() * 10)
- .EUt(2 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(2 * voltageMultiplier, workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -195,7 +206,7 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_EXTRUDER_GEAR)
.outputs(OreDictUnifier.get(gearPrefix, material))
.duration((int) material.getMass() * 5)
- .EUt(8 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, workingTier))
.buildAndRegister();
}
}
@@ -208,29 +219,33 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
material.getProperty(PropertyKey.FLUID).solidifiesFrom(L * (isSmall ? 1 : 4)))
.outputs(stack)
.duration(isSmall ? 20 : 100)
- .EUt(VA[ULV])
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
if (material.hasFlag(GENERATE_PLATE) && material.hasFlag(GENERATE_ROD)) {
if (gearPrefix == OrePrefix.gearSmall) {
- ModHandler.addShapedRecipe(String.format("small_gear_%s", material),
- OreDictUnifier.get(gearSmall, material),
- " R ", "hPx", " R ", 'R', new UnificationEntry(stick, material), 'P',
- new UnificationEntry(plate, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("small_gear_%s", material),
+ OreDictUnifier.get(gearSmall, material),
+ " R ", "hPx", " R ", 'R', new UnificationEntry(stick, material), 'P',
+ new UnificationEntry(plate, material));
+ }
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
.input(OrePrefix.ingot, material)
.notConsumable(MetaItems.SHAPE_EXTRUDER_GEAR_SMALL)
.outputs(stack)
.duration((int) material.getMass())
- .EUt(material.getBlastTemperature() >= 2800 ? 256 : 64)
+ .EUt(GTUtility.scaleVoltage(material.getBlastTemperature() >= 2800 ? 256 : 64, workingTier))
.buildAndRegister();
- RecipeMaps.ALLOY_SMELTER_RECIPES.recipeBuilder().duration((int) material.getMass()).EUt(VA[LV])
+ RecipeMaps.ALLOY_SMELTER_RECIPES.recipeBuilder()
.input(ingot, material, 2)
.notConsumable(MetaItems.SHAPE_MOLD_GEAR_SMALL.getStackForm())
.output(gearSmall, material)
+ .duration((int) material.getMass())
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -239,10 +254,10 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
.notConsumable(MetaItems.SHAPE_EXTRUDER_GEAR_SMALL)
.outputs(stack)
.duration((int) material.getMass())
- .EUt(material.getBlastTemperature() >= 2800 ? 256 : 64)
+ .EUt(GTUtility.scaleVoltage(material.getBlastTemperature() >= 2800 ? 256 : 64, workingTier))
.buildAndRegister();
}
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("gear_%s", material), stack,
"RPR", "PwP", "RPR",
'P', new UnificationEntry(OrePrefix.plate, material),
@@ -253,19 +268,24 @@ public static void processGear(OrePrefix gearPrefix, Material material, DustProp
public static void processLens(OrePrefix lensPrefix, Material material, GemProperty property) {
ItemStack stack = OreDictUnifier.get(lensPrefix, material);
+ int workingTier = material.getWorkingTier();
LATHE_RECIPES.recipeBuilder()
.input(plate, material)
.output(lens, material)
.output(dustSmall, material)
- .duration(1200).EUt(120).buildAndRegister();
+ .duration(1200)
+ .EUt(GTUtility.scaleVoltage(120, workingTier))
+ .buildAndRegister();
if (!OreDictUnifier.get(gemExquisite, material).isEmpty()) {
LATHE_RECIPES.recipeBuilder()
.input(gemExquisite, material)
.output(lens, material)
.output(dust, material, 2)
- .duration(2400).EUt(30).buildAndRegister();
+ .duration(2400)
+ .EUt(GTUtility.scaleVoltage(30, workingTier))
+ .buildAndRegister();
}
if (material == Materials.Diamond) { // override Diamond Lens to be LightBlue
@@ -292,23 +312,27 @@ public static void processPlate(OrePrefix platePrefix, Material material, DustPr
.fluidInputs(material.getProperty(PropertyKey.FLUID).solidifiesFrom(L))
.outputs(OreDictUnifier.get(platePrefix, material))
.duration(40)
- .EUt(VA[ULV])
+ .EUt(GTUtility.scaleVoltage(VA[ULV], material.getWorkingTier()))
.buildAndRegister();
}
}
public static void processPlateDouble(OrePrefix doublePrefix, Material material, IngotProperty property) {
+ int workingTier = material.getWorkingTier();
+
if (material.hasFlag(GENERATE_PLATE)) {
- if (!material.hasFlag(NO_SMASHING)) {
+ if (!material.hasFlag(NO_SMASHING) && workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("plate_double_%s", material),
OreDictUnifier.get(doublePrefix, material),
"h", "P", "P", 'P', new UnificationEntry(plate, material));
}
- BENDER_RECIPES.recipeBuilder().EUt(96).duration((int) material.getMass() * 2)
+ BENDER_RECIPES.recipeBuilder()
.input(plate, material, 2)
.output(doublePrefix, material)
.circuitMeta(2)
+ .duration((int) material.getMass() * 2)
+ .EUt(GTUtility.scaleVoltage(96, workingTier))
.buildAndRegister();
BENDER_RECIPES.recipeBuilder()
@@ -316,18 +340,20 @@ public static void processPlateDouble(OrePrefix doublePrefix, Material material,
.circuitMeta(2)
.output(doublePrefix, material)
.duration((int) material.getMass() * 2)
- .EUt(96)
+ .EUt(GTUtility.scaleVoltage(96, workingTier))
.buildAndRegister();
}
}
public static void processPlateDense(OrePrefix orePrefix, Material material, DustProperty property) {
+ int workingTier = material.getWorkingTier();
+
RecipeMaps.BENDER_RECIPES.recipeBuilder()
.input(OrePrefix.plate, material, 9)
.circuitMeta(9)
.output(orePrefix, material)
.duration((int) Math.max(material.getMass() * 9L, 1L))
- .EUt(96)
+ .EUt(GTUtility.scaleVoltage(96, workingTier))
.buildAndRegister();
if (material.hasProperty(PropertyKey.INGOT)) {
@@ -336,69 +362,87 @@ public static void processPlateDense(OrePrefix orePrefix, Material material, Dus
.circuitMeta(9)
.output(orePrefix, material)
.duration((int) Math.max(material.getMass() * 9L, 1L))
- .EUt(96)
+ .EUt(GTUtility.scaleVoltage(96, workingTier))
.buildAndRegister();
}
}
public static void processRing(OrePrefix ringPrefix, Material material, IngotProperty property) {
+ int workingTier = material.getWorkingTier();
+
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
.input(OrePrefix.ingot, material)
.notConsumable(MetaItems.SHAPE_EXTRUDER_RING)
.outputs(OreDictUnifier.get(ringPrefix, material, 4))
.duration((int) material.getMass() * 2)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
if (!material.hasFlag(NO_SMASHING)) {
- ModHandler.addShapedRecipe(String.format("ring_%s", material),
- OreDictUnifier.get(ringPrefix, material),
- "h ", " X",
- 'X', new UnificationEntry(OrePrefix.stick, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("ring_%s", material),
+ OreDictUnifier.get(ringPrefix, material),
+ "h ", " X",
+ 'X', new UnificationEntry(OrePrefix.stick, material));
+ }
} else {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
.input(OrePrefix.dust, material)
.notConsumable(MetaItems.SHAPE_EXTRUDER_RING)
.outputs(OreDictUnifier.get(ringPrefix, material, 4))
.duration((int) material.getMass() * 2)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
}
public static void processSpringSmall(OrePrefix springPrefix, Material material, IngotProperty property) {
- ModHandler.addShapedRecipe(String.format("spring_small_%s", material.toString()),
- OreDictUnifier.get(springSmall, material),
- " s ", "fRx", 'R', new UnificationEntry(stick, material));
+ int workingTier = material.getWorkingTier();
- BENDER_RECIPES.recipeBuilder().duration((int) (material.getMass() / 2)).EUt(VA[ULV])
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("spring_small_%s", material.toString()),
+ OreDictUnifier.get(springSmall, material),
+ " s ", "fRx", 'R', new UnificationEntry(stick, material));
+ }
+
+ BENDER_RECIPES.recipeBuilder()
.input(stick, material)
.output(springSmall, material, 2)
.circuitMeta(1)
+ .duration((int) (material.getMass() / 2))
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
public static void processSpring(OrePrefix springPrefix, Material material, IngotProperty property) {
+ int workingTier = material.getWorkingTier();
+
RecipeMaps.BENDER_RECIPES.recipeBuilder()
.input(stickLong, material)
.outputs(OreDictUnifier.get(OrePrefix.spring, material))
.circuitMeta(1)
.duration(200)
- .EUt(16)
+ .EUt(GTUtility.scaleVoltage(16, workingTier))
.buildAndRegister();
- ModHandler.addShapedRecipe(String.format("spring_%s", material.toString()),
- OreDictUnifier.get(spring, material),
- " s ", "fRx", " R ", 'R', new UnificationEntry(stickLong, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("spring_%s", material.toString()),
+ OreDictUnifier.get(spring, material),
+ " s ", "fRx", " R ", 'R', new UnificationEntry(stickLong, material));
+ }
}
public static void processRotor(OrePrefix rotorPrefix, Material material, IngotProperty property) {
ItemStack stack = OreDictUnifier.get(rotorPrefix, material);
- ModHandler.addShapedRecipe(String.format("rotor_%s", material.toString()), stack,
- "ChC", "SRf", "CdC",
- 'C', new UnificationEntry(plate, material),
- 'S', new UnificationEntry(screw, material),
- 'R', new UnificationEntry(ring, material));
+ int workingTier = material.getWorkingTier();
+
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("rotor_%s", material.toString()), stack,
+ "ChC", "SRf", "CdC",
+ 'C', new UnificationEntry(plate, material),
+ 'S', new UnificationEntry(screw, material),
+ 'R', new UnificationEntry(ring, material));
+ }
if (material.hasFluid() && material.getProperty(PropertyKey.FLUID).solidifiesFrom() != null) {
RecipeMaps.FLUID_SOLIDFICATION_RECIPES.recipeBuilder()
@@ -406,7 +450,7 @@ public static void processRotor(OrePrefix rotorPrefix, Material material, IngotP
.fluidInputs(material.getProperty(PropertyKey.FLUID).solidifiesFrom(L * 4))
.outputs(GTUtility.copy(stack))
.duration(120)
- .EUt(20)
+ .EUt(GTUtility.scaleVoltage(20, workingTier))
.buildAndRegister();
}
@@ -415,7 +459,7 @@ public static void processRotor(OrePrefix rotorPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_EXTRUDER_ROTOR)
.outputs(GTUtility.copy(stack))
.duration((int) material.getMass() * 4)
- .EUt(material.getBlastTemperature() >= 2800 ? 256 : 64)
+ .EUt(GTUtility.scaleVoltage(material.getBlastTemperature() >= 2800 ? 256 : 64, workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -424,17 +468,19 @@ public static void processRotor(OrePrefix rotorPrefix, Material material, IngotP
.notConsumable(MetaItems.SHAPE_EXTRUDER_ROTOR)
.outputs(GTUtility.copy(stack))
.duration((int) material.getMass() * 4)
- .EUt(material.getBlastTemperature() >= 2800 ? 256 : 64)
+ .EUt(GTUtility.scaleVoltage(material.getBlastTemperature() >= 2800 ? 256 : 64, workingTier))
.buildAndRegister();
}
}
public static void processStick(OrePrefix stickPrefix, Material material, DustProperty property) {
+ int workingTier = material.getWorkingTier();
+
if (material.hasProperty(PropertyKey.GEM) || material.hasProperty(PropertyKey.INGOT)) {
RecipeBuilder> builder = RecipeMaps.LATHE_RECIPES.recipeBuilder()
.input(material.hasProperty(PropertyKey.GEM) ? OrePrefix.gem : OrePrefix.ingot, material)
.duration((int) Math.max(material.getMass() * 2, 1))
- .EUt(16);
+ .EUt(GTUtility.scaleVoltage(16, workingTier));
if (ConfigHolder.recipes.harderRods) {
builder.output(OrePrefix.stick, material);
@@ -451,53 +497,59 @@ public static void processStick(OrePrefix stickPrefix, Material material, DustPr
.input(stickPrefix, material)
.outputs(GTUtility.copy(4, boltStack))
.duration((int) Math.max(material.getMass() * 2L, 1L))
- .EUt(4)
+ .EUt(GTUtility.scaleVoltage(4, workingTier))
.buildAndRegister();
- ModHandler.addShapedRecipe(String.format("bolt_saw_%s", material),
- GTUtility.copy(2, boltStack),
- "s ", " X",
- 'X', new UnificationEntry(OrePrefix.stick, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("bolt_saw_%s", material),
+ GTUtility.copy(2, boltStack),
+ "s ", " X",
+ 'X', new UnificationEntry(OrePrefix.stick, material));
+ }
}
}
public static void processLongStick(OrePrefix longStickPrefix, Material material, DustProperty property) {
ItemStack stack = OreDictUnifier.get(longStickPrefix, material);
ItemStack stickStack = OreDictUnifier.get(OrePrefix.stick, material);
+ int workingTier = material.getWorkingTier();
RecipeMaps.CUTTER_RECIPES.recipeBuilder()
.input(longStickPrefix, material)
.outputs(GTUtility.copy(2, stickStack))
- .duration((int) Math.max(material.getMass(), 1L)).EUt(4)
+ .duration((int) Math.max(material.getMass(), 1L))
+ .EUt(GTUtility.scaleVoltage(4, workingTier))
.buildAndRegister();
- ModHandler.addShapedRecipe(String.format("stick_long_%s", material),
- GTUtility.copy(2, stickStack),
- "s", "X", 'X', new UnificationEntry(OrePrefix.stickLong, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("stick_long_%s", material),
+ GTUtility.copy(2, stickStack),
+ "s", "X", 'X', new UnificationEntry(OrePrefix.stickLong, material));
- if (material.hasProperty(PropertyKey.GEM)) {
- ModHandler.addShapedRecipe(String.format("stick_long_gem_flawless_%s", material),
- stickStack,
- "sf",
- "G ",
- 'G', new UnificationEntry(OrePrefix.gemFlawless, material));
+ if (material.hasProperty(PropertyKey.GEM)) {
+ ModHandler.addShapedRecipe(String.format("stick_long_gem_flawless_%s", material),
+ stickStack,
+ "sf",
+ "G ",
+ 'G', new UnificationEntry(OrePrefix.gemFlawless, material));
- ModHandler.addShapedRecipe(String.format("stick_long_gem_exquisite_%s", material),
- GTUtility.copy(2, stickStack),
- "sf", "G ",
- 'G', new UnificationEntry(OrePrefix.gemExquisite, material));
+ ModHandler.addShapedRecipe(String.format("stick_long_gem_exquisite_%s", material),
+ GTUtility.copy(2, stickStack),
+ "sf", "G ",
+ 'G', new UnificationEntry(OrePrefix.gemExquisite, material));
- }
+ }
- ModHandler.addShapedRecipe(String.format("stick_long_stick_%s", material), stack,
- "ShS",
- 'S', new UnificationEntry(OrePrefix.stick, material));
+ ModHandler.addShapedRecipe(String.format("stick_long_stick_%s", material), stack,
+ "ShS",
+ 'S', new UnificationEntry(OrePrefix.stick, material));
+ }
RecipeMaps.FORGE_HAMMER_RECIPES.recipeBuilder()
.input(OrePrefix.stick, material, 2)
.outputs(stack)
.duration((int) Math.max(material.getMass(), 1L))
- .EUt(16)
+ .EUt(GTUtility.scaleVoltage(16, workingTier))
.buildAndRegister();
if (material.hasProperty(PropertyKey.INGOT)) {
@@ -506,7 +558,7 @@ public static void processLongStick(OrePrefix longStickPrefix, Material material
.notConsumable(MetaItems.SHAPE_EXTRUDER_ROD_LONG)
.outputs(stack)
.duration((int) Math.max(material.getMass(), 1L))
- .EUt(64)
+ .EUt(GTUtility.scaleVoltage(64, workingTier))
.buildAndRegister();
if (material.hasFlag(NO_SMASHING)) {
@@ -515,7 +567,7 @@ public static void processLongStick(OrePrefix longStickPrefix, Material material
.notConsumable(MetaItems.SHAPE_EXTRUDER_ROD_LONG)
.outputs(stack)
.duration((int) Math.max(material.getMass(), 1L))
- .EUt(64)
+ .EUt(GTUtility.scaleVoltage(64, workingTier))
.buildAndRegister();
}
}
@@ -524,6 +576,7 @@ public static void processLongStick(OrePrefix longStickPrefix, Material material
public static void processTurbine(OrePrefix toolPrefix, Material material, IngotProperty property) {
ItemStack rotorStack = MetaItems.TURBINE_ROTOR.getStackForm();
AbstractMaterialPartBehavior.setPartMaterial(rotorStack, material);
+ int workingTier = material.getWorkingTier();
RecipeMaps.ASSEMBLER_RECIPES.recipeBuilder()
.input(OrePrefix.turbineBlade, material, 8)
@@ -539,10 +592,10 @@ public static void processTurbine(OrePrefix toolPrefix, Material material, Ingot
.input(OrePrefix.screw, material, 2)
.outputs(OreDictUnifier.get(toolPrefix, material))
.duration(20)
- .EUt(256)
+ .EUt(GTUtility.scaleVoltage(256, workingTier))
.buildAndRegister();
- if (hasDoublePlate) {
+ if (hasDoublePlate && workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("turbine_blade_%s", material),
OreDictUnifier.get(toolPrefix, material),
"PPP", "SPS", "fPd",
@@ -552,7 +605,9 @@ public static void processTurbine(OrePrefix toolPrefix, Material material, Ingot
}
public static void processRound(OrePrefix roundPrefix, Material material, IngotProperty property) {
- if (!material.hasFlag(NO_SMASHING)) {
+ int workingTier = material.getWorkingTier();
+
+ if (!material.hasFlag(NO_SMASHING) && workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("round_%s", material),
OreDictUnifier.get(round, material),
@@ -563,9 +618,11 @@ public static void processRound(OrePrefix roundPrefix, Material material, IngotP
"fIh", 'I', new UnificationEntry(ingot, material));
}
- LATHE_RECIPES.recipeBuilder().EUt(VA[ULV]).duration(100)
+ LATHE_RECIPES.recipeBuilder()
.input(nugget, material)
.output(round, material)
+ .duration(100)
+ .EUt(GTUtility.scaleVoltage(VA[ULV], workingTier))
.buildAndRegister();
}
diff --git a/src/main/java/gregtech/loaders/recipe/handlers/PipeRecipeHandler.java b/src/main/java/gregtech/loaders/recipe/handlers/PipeRecipeHandler.java
index bd58e4263e8..97a8210f2bc 100644
--- a/src/main/java/gregtech/loaders/recipe/handlers/PipeRecipeHandler.java
+++ b/src/main/java/gregtech/loaders/recipe/handlers/PipeRecipeHandler.java
@@ -80,6 +80,7 @@ private static void processRestrictivePipe(OrePrefix pipePrefix, Material materi
private static void processPipeTiny(OrePrefix pipePrefix, Material material, IMaterialProperty property) {
ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
+ int workingTier = material.getWorkingTier();
// Some pipes like wood do not have an ingot
if (material.hasProperty(PropertyKey.INGOT)) {
@@ -88,7 +89,7 @@ private static void processPipeTiny(OrePrefix pipePrefix, Material material, IMa
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_TINY)
.outputs(GTUtility.copy(2, pipeStack))
.duration((int) (material.getMass()))
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
@@ -98,21 +99,25 @@ private static void processPipeTiny(OrePrefix pipePrefix, Material material, IMa
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_TINY)
.outputs(GTUtility.copy(2, pipeStack))
.duration((int) (material.getMass()))
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
} else {
if (ModHandler.isMaterialWood(material)) {
- ModHandler.addShapedRecipe(String.format("tiny_%s_pipe", material),
- GTUtility.copy(2, pipeStack), " s ", "rXw",
- 'X', new UnificationEntry(OrePrefix.plank, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("tiny_%s_pipe", material),
+ GTUtility.copy(2, pipeStack), " s ", "rXw",
+ 'X', new UnificationEntry(OrePrefix.plank, material));
+ }
- ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[LV])
+ ASSEMBLER_RECIPES.recipeBuilder()
.input(plate, material)
.circuitMeta(18)
.fluidInputs(Glue.getFluid(10))
.output(pipePrefix, material, 2)
+ .duration(200)
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("tiny_%s_pipe", material),
GTUtility.copy(2, pipeStack), " s ", "hXw",
'X', new UnificationEntry(OrePrefix.plate, material));
@@ -122,6 +127,7 @@ private static void processPipeTiny(OrePrefix pipePrefix, Material material, IMa
private static void processPipeSmall(OrePrefix pipePrefix, Material material, IMaterialProperty property) {
ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
+ int workingTier = material.getWorkingTier();
if (material.hasProperty(PropertyKey.INGOT)) {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
@@ -129,7 +135,7 @@ private static void processPipeSmall(OrePrefix pipePrefix, Material material, IM
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_SMALL)
.outputs(pipeStack)
.duration((int) (material.getMass()))
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
@@ -139,22 +145,26 @@ private static void processPipeSmall(OrePrefix pipePrefix, Material material, IM
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_SMALL)
.outputs(pipeStack)
.duration((int) (material.getMass()))
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
} else {
if (ModHandler.isMaterialWood(material)) {
- ModHandler.addShapedRecipe(String.format("small_%s_pipe", material),
- pipeStack, "sXr",
- 'X', new UnificationEntry(OrePrefix.plank, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("small_%s_pipe", material),
+ pipeStack, "sXr",
+ 'X', new UnificationEntry(OrePrefix.plank, material));
+ }
- ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[LV])
+ ASSEMBLER_RECIPES.recipeBuilder()
.input(plate, material)
.circuitMeta(12)
.fluidInputs(Glue.getFluid(10))
.output(pipePrefix, material)
+ .duration(200)
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("small_%s_pipe", material),
pipeStack, "wXh",
'X', new UnificationEntry(OrePrefix.plate, material));
@@ -164,6 +174,7 @@ private static void processPipeSmall(OrePrefix pipePrefix, Material material, IM
private static void processPipeNormal(OrePrefix pipePrefix, Material material, IMaterialProperty property) {
ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
+ int workingTier = material.getWorkingTier();
if (material.hasProperty(PropertyKey.INGOT)) {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
@@ -171,7 +182,7 @@ private static void processPipeNormal(OrePrefix pipePrefix, Material material, I
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_NORMAL)
.outputs(pipeStack)
.duration((int) material.getMass() * 3)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
@@ -181,22 +192,26 @@ private static void processPipeNormal(OrePrefix pipePrefix, Material material, I
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_NORMAL)
.outputs(pipeStack)
.duration((int) material.getMass() * 3)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
} else {
if (ModHandler.isMaterialWood(material)) {
- ModHandler.addShapedRecipe(String.format("medium_%s_pipe", material),
- pipeStack, "XXX", "s r",
- 'X', new UnificationEntry(OrePrefix.plank, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("medium_%s_pipe", material),
+ pipeStack, "XXX", "s r",
+ 'X', new UnificationEntry(OrePrefix.plank, material));
+ }
- ASSEMBLER_RECIPES.recipeBuilder().duration(200).EUt(VA[LV])
+ ASSEMBLER_RECIPES.recipeBuilder()
.input(plate, material, 3)
.circuitMeta(6)
.fluidInputs(Glue.getFluid(20))
.output(pipePrefix, material)
+ .duration(200)
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("medium_%s_pipe", material),
pipeStack, "XXX", "w h",
'X', new UnificationEntry(OrePrefix.plate, material));
@@ -206,6 +221,7 @@ private static void processPipeNormal(OrePrefix pipePrefix, Material material, I
private static void processPipeLarge(OrePrefix pipePrefix, Material material, IMaterialProperty property) {
ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
+ int workingTier = material.getWorkingTier();
if (material.hasProperty(PropertyKey.INGOT)) {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
@@ -213,7 +229,7 @@ private static void processPipeLarge(OrePrefix pipePrefix, Material material, IM
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_LARGE)
.outputs(pipeStack)
.duration((int) material.getMass() * 6)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
@@ -223,21 +239,25 @@ private static void processPipeLarge(OrePrefix pipePrefix, Material material, IM
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_LARGE)
.outputs(pipeStack)
.duration((int) material.getMass() * 6)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
} else {
if (ModHandler.isMaterialWood(material)) {
- ModHandler.addShapedRecipe(String.format("large_%s_pipe", material),
- pipeStack, "XXX", "s r", "XXX",
- 'X', new UnificationEntry(OrePrefix.plank, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("large_%s_pipe", material),
+ pipeStack, "XXX", "s r", "XXX",
+ 'X', new UnificationEntry(OrePrefix.plank, material));
+ }
- ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(VA[LV])
+ ASSEMBLER_RECIPES.recipeBuilder()
.input(plate, material, 6)
.circuitMeta(2)
.fluidInputs(Glue.getFluid(50))
.output(pipePrefix, material)
+ .duration(100)
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("large_%s_pipe", material),
pipeStack, "XXX", "w h", "XXX",
'X', new UnificationEntry(OrePrefix.plate, material));
@@ -247,6 +267,7 @@ private static void processPipeLarge(OrePrefix pipePrefix, Material material, IM
private static void processPipeHuge(OrePrefix pipePrefix, Material material, IMaterialProperty property) {
ItemStack pipeStack = OreDictUnifier.get(pipePrefix, material);
+ int workingTier = material.getWorkingTier();
if (material.hasProperty(PropertyKey.INGOT)) {
RecipeMaps.EXTRUDER_RECIPES.recipeBuilder()
@@ -254,7 +275,7 @@ private static void processPipeHuge(OrePrefix pipePrefix, Material material, IMa
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_HUGE)
.outputs(pipeStack)
.duration((int) material.getMass() * 24)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
@@ -264,21 +285,25 @@ private static void processPipeHuge(OrePrefix pipePrefix, Material material, IMa
.notConsumable(MetaItems.SHAPE_EXTRUDER_PIPE_HUGE)
.outputs(pipeStack)
.duration((int) material.getMass() * 24)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
} else if (OrePrefix.plateDouble.doGenerateItem(material)) {
if (ModHandler.isMaterialWood(material)) {
- ModHandler.addShapedRecipe(String.format("huge_%s_pipe", material),
- pipeStack, "XXX", "s r", "XXX",
- 'X', new UnificationEntry(OrePrefix.plateDouble, material));
+ if (workingTier <= HV) {
+ ModHandler.addShapedRecipe(String.format("huge_%s_pipe", material),
+ pipeStack, "XXX", "s r", "XXX",
+ 'X', new UnificationEntry(OrePrefix.plateDouble, material));
+ }
- ASSEMBLER_RECIPES.recipeBuilder().duration(100).EUt(VA[LV])
+ ASSEMBLER_RECIPES.recipeBuilder()
.input(plateDouble, material, 6)
.circuitMeta(24)
.fluidInputs(Glue.getFluid(100))
.output(pipePrefix, material)
+ .duration(100)
+ .EUt(GTUtility.scaleVoltage(VA[LV], workingTier))
.buildAndRegister();
- } else {
+ } else if (workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("huge_%s_pipe", material),
pipeStack, "XXX", "w h", "XXX",
'X', new UnificationEntry(OrePrefix.plateDouble, material));
diff --git a/src/main/java/gregtech/loaders/recipe/handlers/ToolRecipeHandler.java b/src/main/java/gregtech/loaders/recipe/handlers/ToolRecipeHandler.java
index 84e5cd91450..b8305e64aae 100644
--- a/src/main/java/gregtech/loaders/recipe/handlers/ToolRecipeHandler.java
+++ b/src/main/java/gregtech/loaders/recipe/handlers/ToolRecipeHandler.java
@@ -15,6 +15,7 @@
import gregtech.api.unification.material.properties.ToolProperty;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.api.unification.stack.UnificationEntry;
+import gregtech.api.util.GTUtility;
import gregtech.common.crafting.ToolHeadReplaceRecipe;
import gregtech.common.items.MetaItems;
import gregtech.common.items.ToolItems;
@@ -293,7 +294,7 @@ private static void processElectricTool(OrePrefix prefix, Material material, Too
.input(OrePrefix.gear, material)
.output(toolPrefix, material)
.duration((int) material.getMass() * 4)
- .EUt(8 * voltageMultiplier)
+ .EUt(GTUtility.scaleVoltage(8 * voltageMultiplier, material.getWorkingTier()))
.buildAndRegister();
}
diff --git a/src/main/java/gregtech/loaders/recipe/handlers/WireRecipeHandler.java b/src/main/java/gregtech/loaders/recipe/handlers/WireRecipeHandler.java
index 129150429d5..ee23ac77e59 100644
--- a/src/main/java/gregtech/loaders/recipe/handlers/WireRecipeHandler.java
+++ b/src/main/java/gregtech/loaders/recipe/handlers/WireRecipeHandler.java
@@ -66,13 +66,14 @@ public static void register() {
public static void processWireSingle(OrePrefix wirePrefix, Material material, WireProperties property) {
OrePrefix prefix = material.hasProperty(PropertyKey.INGOT) ? ingot :
material.hasProperty(PropertyKey.GEM) ? gem : dust;
+ int workingTier = material.getWorkingTier();
EXTRUDER_RECIPES.recipeBuilder()
.input(prefix, material)
.notConsumable(SHAPE_EXTRUDER_WIRE)
.output(wireGtSingle, material, 2)
.duration((int) material.getMass() * 2)
- .EUt(6 * getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(6 * getVoltageMultiplier(material), workingTier))
.buildAndRegister();
WIREMILL_RECIPES.recipeBuilder()
@@ -80,7 +81,7 @@ public static void processWireSingle(OrePrefix wirePrefix, Material material, Wi
.circuitMeta(1)
.output(wireGtSingle, material, 2)
.duration((int) material.getMass())
- .EUt(getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(getVoltageMultiplier(material), workingTier))
.buildAndRegister();
for (OrePrefix wireSize : wireSizes) {
@@ -90,11 +91,11 @@ public static void processWireSingle(OrePrefix wirePrefix, Material material, Wi
.circuitMeta(multiplier * 2)
.output(wireSize, material)
.duration((int) (material.getMass() * multiplier))
- .EUt(getVoltageMultiplier(material))
+ .EUt(GTUtility.scaleVoltage(getVoltageMultiplier(material), workingTier))
.buildAndRegister();
}
- if (!material.hasFlag(NO_WORKING) && material.hasFlag(GENERATE_PLATE)) {
+ if (!material.hasFlag(NO_WORKING) && material.hasFlag(GENERATE_PLATE) && workingTier <= HV) {
ModHandler.addShapedRecipe(String.format("%s_wire_single", material),
OreDictUnifier.get(wireGtSingle, material), "Xx",
'X', new UnificationEntry(plate, material));
From 4f2f38b00237c935ed50b4faf81b35e714ac0fa1 Mon Sep 17 00:00:00 2001
From: alongstringofnumbers