diff options
author | Alkalus <draknyte1@hotmail.com> | 2017-09-17 11:14:02 +1000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2017-09-17 11:14:02 +1000 |
commit | 3f385ab38271f2b950d70a07899f80587835887f (patch) | |
tree | b55dfc08e1bde0d4549f84674c8a05651bac0843 | |
parent | 6073fddf0bf0bf731f5120b4fe028f02dbd3a371 (diff) | |
download | GT5-Unofficial-3f385ab38271f2b950d70a07899f80587835887f.tar.gz GT5-Unofficial-3f385ab38271f2b950d70a07899f80587835887f.tar.bz2 GT5-Unofficial-3f385ab38271f2b950d70a07899f80587835887f.zip |
$ Fixed an issue where Multi-block recipe changes affected the actual GT recipes.
% Updated tooltips to reflect time bonuses.
6 files changed, 64 insertions, 27 deletions
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java index f073411c86..3e75fbe356 100644 --- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -131,13 +131,13 @@ public class RECIPES_Machines { public static String pipeTier11 = "pipeHuge"+"Europium"; //IV MACHINES - public static ItemStack IV_MACHINE_Electrolyzer; - public static ItemStack IV_MACHINE_Centrifuge; - public static ItemStack IV_MACHINE_BendingMachine; - public static ItemStack IV_MACHINE_Wiremill; + public static ItemStack EV_MACHINE_Electrolyzer; + public static ItemStack EV_MACHINE_Centrifuge; + public static ItemStack EV_MACHINE_BendingMachine; + public static ItemStack EV_MACHINE_Wiremill; + public static ItemStack HV_MACHINE_Macerator; public static ItemStack EV_MACHINE_Macerator; - public static ItemStack IV_MACHINE_Macerator; - public static ItemStack IV_MACHINE_MassFabricator; + public static ItemStack EV_MACHINE_MassFabricator; //Cables @@ -202,13 +202,13 @@ public class RECIPES_Machines { boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1); //IV MACHINES - IV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1); - IV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1); - IV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1); - EV_MACHINE_Macerator= ItemList.Machine_HV_Macerator.get(1); - IV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); - IV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1); - IV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); + EV_MACHINE_Electrolyzer = ItemList.Machine_EV_Electrolyzer.get(1); + EV_MACHINE_BendingMachine= ItemList.Machine_EV_Bender.get(1); + EV_MACHINE_Wiremill= ItemList.Machine_EV_Wiremill.get(1); + HV_MACHINE_Macerator= ItemList.Machine_HV_Macerator.get(1); + EV_MACHINE_Macerator= ItemList.Machine_EV_Macerator.get(1); + EV_MACHINE_MassFabricator= ItemList.Machine_EV_Massfab.get(1); + EV_MACHINE_Centrifuge= ItemList.Machine_EV_Centrifuge.get(1); } @@ -402,7 +402,7 @@ public class RECIPES_Machines { //Industrial Centrifuge RecipeUtils.addShapedGregtechRecipe( CI.circuitTier5, pipeHugeStainlessSteel, CI.circuitTier5, - CI.component_Plate[6], IV_MACHINE_Centrifuge, CI.component_Plate[6], + CI.component_Plate[6], EV_MACHINE_Centrifuge, CI.component_Plate[6], CI.component_Plate[8], CI.machineCasing_IV, CI.component_Plate[8], RECIPE_IndustrialCentrifugeController); //Centrifuge Casing @@ -470,7 +470,7 @@ public class RECIPES_Machines { //Industrial Electrolyzer RecipeUtils.addShapedGregtechRecipe( "plateStellite", CI.circuitTier5, "plateStellite", - CI.machineCasing_EV, IV_MACHINE_Electrolyzer, CI.machineCasing_EV, + CI.machineCasing_EV, EV_MACHINE_Electrolyzer, CI.machineCasing_EV, "plateStellite", "rotorStellite", "plateStellite", RECIPE_IndustrialElectrolyzerController); } @@ -489,7 +489,7 @@ public class RECIPES_Machines { //Industrial Material Press RecipeUtils.addShapedGregtechRecipe( "plateTitanium", CI.circuitTier5, "plateTitanium", - CI.machineCasing_EV, IV_MACHINE_BendingMachine, CI.machineCasing_EV, + CI.machineCasing_EV, EV_MACHINE_BendingMachine, CI.machineCasing_EV, "plateTitanium", CI.circuitTier5, "plateTitanium", RECIPE_IndustrialMaterialPressController); } @@ -507,8 +507,8 @@ public class RECIPES_Machines { RECIPE_IndustrialMacerationStackFrame); //Industrial Maceration stack RecipeUtils.addShapedGregtechRecipe( - "plateTungstenCarbide", IV_MACHINE_Macerator, "plateTungstenCarbide", - EV_MACHINE_Macerator, CI.circuitTier7, EV_MACHINE_Macerator, + "plateTungstenCarbide", EV_MACHINE_Macerator, "plateTungstenCarbide", + HV_MACHINE_Macerator, CI.circuitTier7, HV_MACHINE_Macerator, "plateTungstenCarbide", CI.machineCasing_IV, "plateTungstenCarbide", RECIPE_IndustrialMacerationStackController); } @@ -527,7 +527,7 @@ public class RECIPES_Machines { //Industrial Wire Factory RecipeUtils.addShapedGregtechRecipe( "plateZeron100", CI.machineCasing_IV, "plateZeron100", - CI.circuitTier5, IV_MACHINE_Wiremill, CI.circuitTier5, + CI.circuitTier5, EV_MACHINE_Wiremill, CI.circuitTier5, "plateZeron100", CI.machineCasing_IV, "plateZeron100", RECIPE_IndustrialWireFactoryController); } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 9f9d4a17af..911ba9a88e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -19,6 +19,7 @@ import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.array.Pair; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MultiMachine; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine; import net.minecraft.entity.player.EntityPlayer; @@ -962,6 +963,38 @@ public abstract class GregtechMeta_MultiBlockBase extends MetaTileEntity { return tValidOutputHatches; } + + public GT_Recipe reduceRecipeTimeByPercentage(GT_Recipe tRecipe, float percentage){ + int cloneTime = 0; + GT_Recipe baseRecipe; + GT_Recipe cloneRecipe = null; + + baseRecipe = tRecipe.copy(); + if (cloneRecipe != baseRecipe || cloneRecipe == null){ + cloneRecipe = baseRecipe.copy(); + Utils.LOG_WARNING("Setting Recipe"); + } + if (cloneTime != baseRecipe.mDuration || cloneTime == 0){ + cloneTime = baseRecipe.mDuration; + Utils.LOG_WARNING("Setting Time"); + } + + if (cloneRecipe.mDuration > 0){ + int originalTime = cloneRecipe.mDuration; + int tempTime = MathUtils.findPercentageOfInt(cloneRecipe.mDuration, (100-percentage)); + cloneRecipe.mDuration = tempTime; + if (cloneRecipe.mDuration < originalTime){ + return cloneRecipe; + } + else { + return tRecipe; + } + } + return null; + + + + } } diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java index 099c295315..7a35f63605 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -57,6 +57,7 @@ extends GregtechMeta_MultiBlockBase { public String[] getDescription() { return new String[]{ "Controller Block for the Industrial Centrifuge", + "40% faster than using single block machines of the same voltage", "Size: 3x3x3 (Hollow)", "Controller (Front Center) [Orange]", "1x Maintenance Hatch (Rear Center) [Green]", @@ -117,8 +118,8 @@ extends GregtechMeta_MultiBlockBase { final ArrayList<FluidStack> tFluidList = this.getStoredFluids(); final FluidStack[] tFluids = tFluidList.toArray(new FluidStack[tFluidList.size()]); if ((tInputList.size() > 0) || (tFluids.length > 0)) { - final GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - tRecipe.mDuration = MathUtils.findPercentageOfInt(tRecipe.mDuration, 80); + GT_Recipe tRecipe = map.findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 40F); if (tRecipe != null) { Utils.LOG_WARNING("Recipe was not invalid"); this.mLastRecipe = tRecipe; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java index 5d30bfd91b..82f7fc3e78 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -45,6 +45,7 @@ extends GregtechMeta_MultiBlockBase { @Override public String[] getDescription() { return new String[]{"Controller Block for the Industrial Electrolyzer", + "40% faster than using single block machines of the same voltage", "Size: 3x3x3 (Hollow)", "Controller (front centered)", "1x Input Bus (anywhere)", @@ -123,8 +124,8 @@ extends GregtechMeta_MultiBlockBase { if ((tInputList.size() > 0) && (tValidOutputSlots >= 1)) { final long tVoltage = this.getMaxInputVoltage(); final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - tRecipe.mDuration = MathUtils.findPercentageOfInt(tRecipe.mDuration, 80); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); + tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 40F); if ((tRecipe != null) && (7500 >= tRecipe.mSpecialValue) && (tRecipe.isRecipeInputEqual(true, tFluids, tInputs))) { this.mEfficiency = (10000 - ((this.getIdealStatus() - this.getRepairStatus()) * 1000)); this.mEfficiencyIncrease = 10000; diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java index 443be193be..48d5ee7452 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java @@ -48,6 +48,7 @@ extends GregtechMeta_MultiBlockBase { public String[] getDescription() { return new String[]{ "Controller Block for the Industrial Maceration Stack", + "60% faster than using single block machines of the same voltage", "Processes material several factors faster than single block macerators", "Has extra chances on bonus outputs", "Processes 8*tier materials at a time", @@ -142,8 +143,8 @@ extends GregtechMeta_MultiBlockBase { } for (int rx=0;rx<processing;rx++){ //Make a recipe instance for the rest of the method. - final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); - tRecipe.mDuration = MathUtils.findPercentageOfInt(tRecipe.mDuration, 60); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(this.getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs); + tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 60F); final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), tRecipe, tInputs); Utils.LOG_WARNING("Maceration Stack - Valid Output Hatches: "+tValidOutputSlots); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java index a92275a11b..50dbed4fb9 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java @@ -41,6 +41,7 @@ extends GregtechMeta_MultiBlockBase { public String[] getDescription() { return new String[]{ "Controller Block for the Industrial Wire Factory", + "60% faster than using single block machines of the same voltage", "Size: 3x5x3 [WxLxH] (Hollow)", "Controller (front centered)", "2x Input Bus (side centered)", "2x Output Bus (side centered)", @@ -81,8 +82,8 @@ extends GregtechMeta_MultiBlockBase { final long tVoltage = this.getMaxInputVoltage(); final byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - final GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); - tRecipe.mDuration = MathUtils.findPercentageOfInt(tRecipe.mDuration, 80); + GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sWiremillRecipes.findRecipe(this.getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], null, new ItemStack[]{tInput}); + tRecipe = this.reduceRecipeTimeByPercentage(tRecipe, 60F); if (tRecipe != null) { final int tValidOutputSlots = this.getValidOutputSlots(this.getBaseMetaTileEntity(), tRecipe, new ItemStack[]{tInput}); |