From 90d63a4a2bf7061d9a829b0f26386175e5dd9eca Mon Sep 17 00:00:00 2001 From: Спартак Date: Tue, 3 Sep 2019 13:11:30 +0300 Subject: ? --- .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 314 +++++++++------------ 1 file changed, 129 insertions(+), 185 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 353a62c319..72105f2074 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -1,6 +1,5 @@ package gregtech.api.metatileentity.implementations; -import cpw.mods.fml.common.Loader; import gregtech.api.enums.*; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -10,7 +9,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_ModHandler.RecipeBits; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import net.minecraft.entity.player.InventoryPlayer; @@ -22,7 +23,9 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.Locale; import java.util.Random; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GT_Values.V; +import static gregtech.api.enums.GT_Values.W; +import static gregtech.api.enums.GT_Values.ticksBetweenSounds; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -31,78 +34,70 @@ import static gregtech.api.enums.GT_Values.*; * Extend this class to make a simple Machine */ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine { - private final GT_Recipe.GT_Recipe_Map mRecipes; + private final GT_Recipe_Map mRecipes; private final int mTankCapacity, mSpecialEffect; private final String mSound; private final boolean mSharedTank, mRequiresFluidForFiltering; private final byte mGUIParameterA, mGUIParameterB; - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { - super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))); - this.mSharedTank = aSharedTank; - this.mTankCapacity = aTankCapacity; - this.mSpecialEffect = aSpecialEffect; - this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; - this.mRecipes = aRecipes; - this.mSound = aSound; - this.mGUIParameterA = (byte) aGUIParameterA; - this.mGUIParameterB = (byte) aGUIParameterB; + public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))}); + mSharedTank = aSharedTank; + mTankCapacity = aTankCapacity; + mSpecialEffect = aSpecialEffect; + mRequiresFluidForFiltering = aRequiresFluidForFiltering; + mRecipes = aRecipes; + mSound = aSound; + mGUIParameterA = (byte) aGUIParameterA; + mGUIParameterB = (byte) aGUIParameterB; //TODO: CHECK if (aRecipe != null) { for (int i = 3; i < aRecipe.length; i++) { - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[this.mTier].mManagingObject; + if (aRecipe[i] == X.CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject; continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[this.mTier].mBetterManagingObject; + if (aRecipe[i] == X.BETTER_CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject; continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL) { - aRecipe[i] = Tier.ELECTRIC[this.mTier].mHullObject; + if (aRecipe[i] == X.HULL) { + aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject; continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE) { - aRecipe[i] = Tier.ELECTRIC[this.mTier].mConductingObject; + if (aRecipe[i] == X.WIRE) { + aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject; continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4) { - aRecipe[i] = Tier.ELECTRIC[this.mTier].mLargerConductingObject; + if (aRecipe[i] == X.WIRE4) { + aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject; continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS) { - switch (this.mTier) { - case 0: - case 1: - case 2: - case 3: - aRecipe[i] = new ItemStack(Blocks.glass, 1, W); - break; - case 4: - case 5: + if (aRecipe[i] == X.GLASS) { + switch (mTier) { case 6: case 7: case 8: - if (Loader.isModLoaded("bartworks")) { - aRecipe[i] = "blockGlass"+VN[aTier]; - break; - } + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + aRecipe[i] = Ic2Items.reinforcedGlass; + break; default: - if (Loader.isModLoaded("bartworks")) { - aRecipe[i] = "blockGlass"+VN[8]; - break; - } else { - aRecipe[i] = Ic2Items.reinforcedGlass; - break; - } + aRecipe[i] = new ItemStack(Blocks.glass, 1, W); + break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE) { - switch (this.mTier) { + if (aRecipe[i] == X.PLATE) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.plate.get(Materials.Steel); @@ -125,6 +120,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = OrePrefixes.plate.get(Materials.HSSE); break; + case 8: + aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); + break; default: aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); break; @@ -132,8 +130,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PIPE) { - switch (this.mTier) { + if (aRecipe[i] == X.PIPE) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze); @@ -160,14 +158,14 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.pipeLarge.get(Materials.Ultimate); break; default: - aRecipe[i] = OrePrefixes.pipeHuge.get(Materials.Ultimate); + aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Ultimate); break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING) { - switch (this.mTier) { + if (aRecipe[i] == X.COIL_HEATING) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper); @@ -193,9 +191,6 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.NaquadahAlloy); break; - case 9: - aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); - break; default: aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); break; @@ -203,8 +198,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING_DOUBLE) { - switch (this.mTier) { + if (aRecipe[i] == X.COIL_HEATING_DOUBLE) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper); @@ -230,9 +225,6 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); break; - case 9: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); - break; default: aRecipe[i] = OrePrefixes.wireGt16.get(Materials.NaquadahAlloy); break; @@ -240,8 +232,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_DISTILLATION) { - switch (this.mTier) { + if (aRecipe[i] == X.STICK_DISTILLATION) { + switch (mTier) { default: aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze); break; @@ -249,8 +241,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_MAGNETIC) { - switch (this.mTier) { + if (aRecipe[i] == X.STICK_MAGNETIC) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic); @@ -274,8 +266,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_ELECTROMAGNETIC) { - switch (this.mTier) { + if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron); @@ -294,10 +286,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_ELECTRIC) { - switch (this.mTier) { + if (aRecipe[i] == X.COIL_ELECTRIC) { + switch (mTier) { case 0: - aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Lead); + aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin); break; case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin); @@ -312,23 +304,23 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); break; case 5: - aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper); + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); break; case 6: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.YttriumBariumCuprate); break; case 7: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Iridium); + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.SuperconductorUHV); break; default: - aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Osmium); + aRecipe[i] = OrePrefixes.wireGt16.get(Materials.SuperconductorUHV); break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM) { - switch (this.mTier) { + if (aRecipe[i] == X.ROBOT_ARM) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Robot_Arm_LV; @@ -351,21 +343,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Robot_Arm_ZPM; break; - case 8: - aRecipe[i] = ItemList.Robot_Arm_UV; - break; - case 9: - aRecipe[i] = ItemList.Robot_Arm_UHV; - break; default: - aRecipe[i] = ItemList.Robot_Arm_UEV; + aRecipe[i] = ItemList.Robot_Arm_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP) { - switch (this.mTier) { + if (aRecipe[i] == X.PUMP) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Pump_LV; @@ -388,21 +374,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Pump_ZPM; break; - case 8: - aRecipe[i] = ItemList.Electric_Pump_UV; - break; - case 9: - aRecipe[i] = ItemList.Electric_Pump_UHV; - break; default: - aRecipe[i] = ItemList.Electric_Pump_UEV; + aRecipe[i] = ItemList.Electric_Pump_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROTOR) { - switch (this.mTier) { + if (aRecipe[i] == X.ROTOR) { + switch (mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin); @@ -432,8 +412,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR) { - switch (this.mTier) { + if (aRecipe[i] == X.MOTOR) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Motor_LV; @@ -456,21 +436,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Motor_ZPM; break; - case 8: - aRecipe[i] = ItemList.Electric_Motor_UV; - break; - case 9: - aRecipe[i] = ItemList.Electric_Motor_UHV; - break; default: - aRecipe[i] = ItemList.Electric_Motor_UEV; + aRecipe[i] = ItemList.Electric_Motor_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON) { - switch (this.mTier) { + if (aRecipe[i] == X.PISTON) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Piston_LV; @@ -493,21 +467,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Piston_ZPM; break; - case 8: - aRecipe[i] = ItemList.Electric_Piston_UV; - break; - case 9: - aRecipe[i] = ItemList.Electric_Piston_UHV; - break; default: - aRecipe[i] = ItemList.Electric_Piston_UEV; + aRecipe[i] = ItemList.Electric_Piston_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR) { - switch (this.mTier) { + if (aRecipe[i] == X.CONVEYOR) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Conveyor_Module_LV; @@ -530,21 +498,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Conveyor_Module_ZPM; break; - case 8: - aRecipe[i] = ItemList.Conveyor_Module_UV; - break; - case 9: - aRecipe[i] = ItemList.Conveyor_Module_UHV; - break; default: - aRecipe[i] = ItemList.Conveyor_Module_UEV; + aRecipe[i] = ItemList.Conveyor_Module_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER) { - switch (this.mTier) { + if (aRecipe[i] == X.EMITTER) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Emitter_LV; @@ -567,21 +529,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Emitter_ZPM; break; - case 8: - aRecipe[i] = ItemList.Emitter_UV; - break; - case 9: - aRecipe[i] = ItemList.Emitter_UHV; - break; default: - aRecipe[i] = ItemList.Emitter_UEV; + aRecipe[i] = ItemList.Emitter_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.SENSOR) { - switch (this.mTier) { + if (aRecipe[i] == X.SENSOR) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Sensor_LV; @@ -604,21 +560,15 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Sensor_ZPM; break; - case 8: - aRecipe[i] = ItemList.Sensor_UV; - break; - case 9: - aRecipe[i] = ItemList.Sensor_UHV; - break; default: - aRecipe[i] = ItemList.Sensor_UEV; + aRecipe[i] = ItemList.Sensor_UV; break; } continue; } - if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.FIELD_GENERATOR) { - switch (this.mTier) { + if (aRecipe[i] == X.FIELD_GENERATOR) { + switch (mTier) { case 0: case 1: aRecipe[i] = ItemList.Field_Generator_LV; @@ -641,56 +591,50 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Field_Generator_ZPM; break; - case 8: - aRecipe[i] = ItemList.Field_Generator_UV; - break; - case 9: - aRecipe[i] = ItemList.Field_Generator_UHV; - break; default: - aRecipe[i] = ItemList.Field_Generator_UEV; + aRecipe[i] = ItemList.Field_Generator_UV; break; } continue; } - if (aRecipe[i] instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe.X) + if (aRecipe[i] instanceof X) throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier); } - if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, aRecipe)) { + if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) { throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName()); } } } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - this.mSharedTank = aSharedTank; - this.mTankCapacity = aTankCapacity; - this.mSpecialEffect = aSpecialEffect; - this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; - this.mRecipes = aRecipes; - this.mSound = aSound; - this.mGUIParameterA = (byte) aGUIParameterA; - this.mGUIParameterB = (byte) aGUIParameterB; + mSharedTank = aSharedTank; + mTankCapacity = aTankCapacity; + mSpecialEffect = aSpecialEffect; + mRequiresFluidForFiltering = aRequiresFluidForFiltering; + mRecipes = aRecipes; + mSound = aSound; + mGUIParameterA = (byte) aGUIParameterA; + mGUIParameterB = (byte) aGUIParameterB; } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - this.mSharedTank = aSharedTank; - this.mTankCapacity = aTankCapacity; - this.mSpecialEffect = aSpecialEffect; - this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; - this.mRecipes = aRecipes; - this.mSound = aSound; - this.mGUIParameterA = (byte) aGUIParameterA; - this.mGUIParameterB = (byte) aGUIParameterB; + mSharedTank = aSharedTank; + mTankCapacity = aTankCapacity; + mSpecialEffect = aSpecialEffect; + mRequiresFluidForFiltering = aRequiresFluidForFiltering; + mRecipes = aRecipes; + mSound = aSound; + mGUIParameterA = (byte) aGUIParameterA; + mGUIParameterB = (byte) aGUIParameterB; } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicMachine_GT_Recipe(this.mName, this.mTier, this.mDescriptionArray, this.mRecipes, this.mInputSlotCount, this.mOutputItems == null ? 0 : this.mOutputItems.length, this.mTankCapacity, this.mAmperage, this.mGUIParameterA, this.mGUIParameterB, this.mTextures, this.mGUIName, this.mNEIName, this.mSound, this.mSharedTank, this.mRequiresFluidForFiltering, this.mSpecialEffect); + return new GT_MetaTileEntity_BasicMachine_GT_Recipe(mName, mTier, mDescriptionArray, mRecipes, mInputSlotCount, mOutputItems == null ? 0 : mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect); } @Override @@ -700,22 +644,22 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), this.mGUIName, GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "", this.mGUIParameterA, this.mGUIParameterB); + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB); } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false; - if (this.mInventory[aIndex] != null) return true; - switch (this.mInputSlotCount) { + if (mInventory[aIndex] != null) return true; + switch (mInputSlotCount) { case 0: return false; case 1: - return this.getFillableStack() == null ? !this.mRequiresFluidForFiltering && this.getRecipeList().containsInput(aStack) : null != this.getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, true, V[this.mTier], new FluidStack[]{this.getFillableStack()}, this.getSpecialSlot(), new ItemStack[]{aStack}); + return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), new ItemStack[]{aStack}); case 2: - return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0) != null && this.getInputAt(1) != null) || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList().containsInput(aStack) : (this.getRecipeList().containsInput(aStack) && null != this.getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, true, V[this.mTier], new FluidStack[]{this.getFillableStack()}, this.getSpecialSlot(), aIndex == this.getInputSlot() ? new ItemStack[]{aStack, this.getInputAt(1)} : new ItemStack[]{this.getInputAt(0), aStack}))))); + return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0) != null && getInputAt(1) != null) || (getInputAt(0) == null && getInputAt(1) == null ? getRecipeList().containsInput(aStack) : (getRecipeList().containsInput(aStack) && null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[]{aStack, getInputAt(1)} : new ItemStack[]{getInputAt(0), aStack}))))); default:{ - int tID = this.getBaseMetaTileEntity().getMetaTileID(); + int tID = getBaseMetaTileEntity().getMetaTileID(); if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) {//assembler lv-iv; circuit asseblers lv - uv; assemblers luv-uev if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) { @@ -723,7 +667,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ return true; } } - return this.getRecipeList().containsInput(aStack); + return getRecipeList().containsInput(aStack); } } @@ -734,7 +678,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { - switch (this.mSpecialEffect) { + switch (mSpecialEffect) { case 0: break; case 1: @@ -748,27 +692,27 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } @Override - public GT_Recipe.GT_Recipe_Map getRecipeList() { - return this.mRecipes; + public GT_Recipe_Map getRecipeList() { + return mRecipes; } @Override public int getCapacity() { - return this.mTankCapacity; + return mTankCapacity; } @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == 1 && GT_Utility.isStringValid(this.mSound)) GT_Utility.doSoundAtClient(this.mSound, 100, 1.0F, aX, aY, aZ); + if (aIndex == 1 && GT_Utility.isStringValid(mSound)) GT_Utility.doSoundAtClient(mSound, 100, 1.0F, aX, aY, aZ); } @Override public void startProcess() { - BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity()); + BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity)getBaseMetaTileEntity()); // Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent. if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick+ticksBetweenSounds)) { - if (GT_Utility.isStringValid(this.mSound)) this.sendLoopStart((byte) 1); + if (GT_Utility.isStringValid(mSound)) sendLoopStart((byte) 1); // Does not have overflow protection, but they are longs. myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; } @@ -776,18 +720,18 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public FluidStack getFillableStack() { - return this.mSharedTank ? this.getDrainableStack() : super.getFillableStack(); + return mSharedTank ? getDrainableStack() : super.getFillableStack(); } @Override public FluidStack setFillableStack(FluidStack aFluid) { - return this.mSharedTank ? this.setDrainableStack(aFluid) : super.setFillableStack(aFluid); + return mSharedTank ? setDrainableStack(aFluid) : super.setFillableStack(aFluid); } @Override protected boolean displaysOutputFluid() { - return !this.mSharedTank; + return !mSharedTank; } - public enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC} + public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC} } -- cgit From 04829509b07c545bb85ef36a63b561f4174e425b Mon Sep 17 00:00:00 2001 From: Спартак Date: Tue, 3 Sep 2019 13:14:26 +0300 Subject: Add Space Coolant --- src/main/java/gregtech/api/enums/ItemList.java | 1 + src/main/java/gregtech/api/enums/Materials.java | 2 ++ .../loaders/preload/GT_Loader_Item_Block_And_Fluid.java | 15 +++++++++++++++ .../textures/items/gt.1080k_Space_Coolantcell.png | Bin 0 -> 333 bytes .../textures/items/gt.180k_Space_Coolantcell.png | Bin 0 -> 306 bytes .../textures/items/gt.360k_Space_Coolantcell.png | Bin 0 -> 335 bytes .../textures/items/gt.540k_Space_Coolantcell.png | Bin 0 -> 330 bytes 7 files changed, 18 insertions(+) create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.1080k_Space_Coolantcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.180k_Space_Coolantcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.360k_Space_Coolantcell.png create mode 100644 src/main/resources/assets/gregtech/textures/items/gt.540k_Space_Coolantcell.png (limited to 'src/main/java') diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index 99452607d4..ca5da1dadd 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -652,6 +652,7 @@ public enum ItemList implements IItemContainer { Neutron_Reflector, Reactor_Coolant_He_1, Reactor_Coolant_He_3, Reactor_Coolant_He_6, Reactor_Coolant_NaK_1, Reactor_Coolant_NaK_3, Reactor_Coolant_NaK_6,neutroniumHeatCapacitor, ThoriumCell_1, ThoriumCell_2, ThoriumCell_4, + Reactor_Coolant_Sp_1, Reactor_Coolant_Sp_2, Reactor_Coolant_Sp_3, Reactor_Coolant_Sp_6, FusionComputer_LuV, FusionComputer_ZPMV, FusionComputer_UV, Casing_Fusion_Coil, Casing_Fusion, Casing_Fusion2, Generator_Plasma_IV, Generator_Plasma_LuV, Generator_Plasma_ZPMV, diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index a3b262c6ca..ef06709e35 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -836,6 +836,8 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { public static Materials SuperconductorUV = new Materials( -1, TextureSet.SET_SHINY , 1.0F, 0, 0, 0 , 224,210, 7, 0, "SuperconductorUV" , "Superconductor UV" , 0, 0, -1, -1, false, false, 1, 1, 1, Dyes.dyeYellow , Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 48))); public static Materials SuperconductorUHV = new Materials( -1, TextureSet.SET_SHINY , 1.0F, 0, 0, 0 , 255,255, 255, 0, "Superconductor" , "Superconductor UHV" , 0, 0, -1, -1, false, false, 1, 1, 1, Dyes.dyeWhite , Arrays.asList(new TC_AspectStack(TC_Aspects.ELECTRUM, 64))); + public static Materials SuperCoolant = new MaterialBuilder( -1, TextureSet.SET_DULL,"Super Coolant").setRGB(2, 91, 111).addFluid().constructMaterial().setLiquidTemperature(1); + /** * Materials which are renamed automatically */ diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java index 54be8d5a11..6308afdd14 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java @@ -109,6 +109,21 @@ public class GT_Loader_Item_Block_And_Fluid ItemList.Reactor_Coolant_NaK_6.set(GregTech_API.constructCoolantCellItem("360k_NaK_Coolantcell", "360k NaK Coolantcell", 360000)); GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_NaK_6.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"PCP", "PDP", "PCP", 'C', ItemList.Reactor_Coolant_NaK_3, 'P', OrePrefixes.plate.get(Materials.Tin), 'D', OrePrefixes.plateDense.get(Materials.Copper)}); + + ItemList.Reactor_Coolant_Sp_1.set(GregTech_API.constructCoolantCellItem("180k_Space_Coolantcell", "180k Sp Coolant Cell", 180000)); + + ItemList.Reactor_Coolant_Sp_2.set(GregTech_API.constructCoolantCellItem("360k_Space_Coolantcell", "360k Sp Coolant Cell", 360000)); + GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_Sp_2.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"CPC", 'C', ItemList.Reactor_Coolant_Sp_1, 'P', OrePrefixes.plateTriple.get(Materials.TungstenSteel)}); + + ItemList.Reactor_Coolant_Sp_3.set(GregTech_API.constructCoolantCellItem("540k_Space_Coolantcell", "540k Sp Coolant Cell", 540000)); + GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_Sp_3.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"PPP", "CCC", "PPP", 'C', ItemList.Reactor_Coolant_Sp_1, 'P', OrePrefixes.plate.get(Materials.TungstenSteel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_Sp_3.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"PPP", "BPC", "PPP", 'C', ItemList.Reactor_Coolant_Sp_1, 'B', ItemList.Reactor_Coolant_Sp_2, 'P', OrePrefixes.plate.get(Materials.TungstenSteel)}); + GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_Sp_3.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"PPP", "CPB", "PPP", 'C', ItemList.Reactor_Coolant_Sp_1, 'B', ItemList.Reactor_Coolant_Sp_2, 'P', OrePrefixes.plate.get(Materials.TungstenSteel)}); + + ItemList.Reactor_Coolant_Sp_6.set(GregTech_API.constructCoolantCellItem("1080k_Space_Coolantcell", "1080k Sp Coolant Cell", 1080000)); + GT_ModHandler.addCraftingRecipe(ItemList.Reactor_Coolant_Sp_6.get(1L, new Object[0]), GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[]{"PCP", "PDP", "PCP", 'C', ItemList.Reactor_Coolant_Sp_3, 'P', OrePrefixes.plate.get(Materials.TungstenSteel), 'D', OrePrefixes.plateDense.get(Materials.ElectrumFlux)}); + + if (!GregTech_API.mIC2Classic) { ItemList.neutroniumHeatCapacitor.set(GregTech_API.constructCoolantCellItem("neutroniumHeatCapacitor", "1G Neutronium Heat Capacitor", 1000000000)); diff --git a/src/main/resources/assets/gregtech/textures/items/gt.1080k_Space_Coolantcell.png b/src/main/resources/assets/gregtech/textures/items/gt.1080k_Space_Coolantcell.png new file mode 100644 index 0000000000..69acf28925 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.1080k_Space_Coolantcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.180k_Space_Coolantcell.png b/src/main/resources/assets/gregtech/textures/items/gt.180k_Space_Coolantcell.png new file mode 100644 index 0000000000..72a605ec91 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.180k_Space_Coolantcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.360k_Space_Coolantcell.png b/src/main/resources/assets/gregtech/textures/items/gt.360k_Space_Coolantcell.png new file mode 100644 index 0000000000..f0edc59189 Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.360k_Space_Coolantcell.png differ diff --git a/src/main/resources/assets/gregtech/textures/items/gt.540k_Space_Coolantcell.png b/src/main/resources/assets/gregtech/textures/items/gt.540k_Space_Coolantcell.png new file mode 100644 index 0000000000..7efb2df88e Binary files /dev/null and b/src/main/resources/assets/gregtech/textures/items/gt.540k_Space_Coolantcell.png differ -- cgit From fb29e925750ca460b10c19276aba4c37e8221a4d Mon Sep 17 00:00:00 2001 From: Спартак Date: Tue, 3 Sep 2019 13:15:01 +0300 Subject: Add new Coolant in AssLine recipes --- .../loaders/postload/GT_MachineRecipeLoader.java | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index 1d1d91607d..90910ed58f 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -2564,8 +2564,8 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_UHPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Master), 2}, ItemList.LuV_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_3.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_3.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_3.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_3.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_1.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_3.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_3.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_1.get(1, new Object(){})}, ItemList.Electric_Pump_LuV.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), @@ -2579,8 +2579,8 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_NPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 2}, ItemList.ZPM_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, ItemList.Electric_Pump_ZPM.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), @@ -2593,10 +2593,10 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_PPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 2}, ItemList.UV_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, ItemList.Electric_Pump_UV.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 8000), @@ -2610,8 +2610,8 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_UHPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Master), 2}, ItemList.LuV_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_3.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_3.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_3.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_3.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_1.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_3.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_3.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_1.get(1, new Object(){})}, ItemList.Electric_Pump_LuV.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 2000), @@ -2625,8 +2625,8 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_NPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Ultimate), 2}, ItemList.ZPM_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, ItemList.Electric_Pump_ZPM.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 4000), @@ -2639,10 +2639,10 @@ public class GT_MachineRecipeLoader implements Runnable { ItemList.Circuit_Chip_PPIC.get(2L, new Object(){}), new Object[]{OrePrefixes.circuit.get(Materials.Superconductor), 2}, ItemList.UV_Coil.get(2L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), - ItemList.Reactor_Coolant_He_6.get(1L, new Object(){}), + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, + new ItemStack[]{ItemList.Reactor_Coolant_He_6.get(1, new Object(){}), ItemList.Reactor_Coolant_NaK_6.get(1, new Object(){}), ItemList.Reactor_Coolant_Sp_2.get(1, new Object(){})}, ItemList.Electric_Pump_UV.get(1L, new Object(){})}, new FluidStack[]{ new FluidStack(FluidRegistry.getFluid("ic2coolant"), 8000), -- cgit From 4bc1c58c93115c77bf5c93d3a3314a75559c522d Mon Sep 17 00:00:00 2001 From: Спартак Date: Tue, 3 Sep 2019 13:18:05 +0300 Subject: Revert "?" This reverts commit 90d63a4a2bf7061d9a829b0f26386175e5dd9eca. --- .../GT_MetaTileEntity_BasicMachine_GT_Recipe.java | 314 ++++++++++++--------- 1 file changed, 185 insertions(+), 129 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java index 72105f2074..353a62c319 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GT_Recipe.java @@ -1,5 +1,6 @@ package gregtech.api.metatileentity.implementations; +import cpw.mods.fml.common.Loader; import gregtech.api.enums.*; import gregtech.api.gui.GT_Container_BasicMachine; import gregtech.api.gui.GT_GUIContainer_BasicMachine; @@ -9,9 +10,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_ModHandler.RecipeBits; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import ic2.core.Ic2Items; import net.minecraft.entity.player.InventoryPlayer; @@ -23,9 +22,7 @@ import net.minecraftforge.oredict.OreDictionary; import java.util.Locale; import java.util.Random; -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.GT_Values.W; -import static gregtech.api.enums.GT_Values.ticksBetweenSounds; +import static gregtech.api.enums.GT_Values.*; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -34,70 +31,78 @@ import static gregtech.api.enums.GT_Values.ticksBetweenSounds; * Extend this class to make a simple Machine */ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_BasicMachine { - private final GT_Recipe_Map mRecipes; + private final GT_Recipe.GT_Recipe_Map mRecipes; private final int mTankCapacity, mSpecialEffect; private final String mSound; private final boolean mSharedTank, mRequiresFluidForFiltering; private final byte mGUIParameterA, mGUIParameterB; - public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { - super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))}); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + public GT_MetaTileEntity_BasicMachine_GT_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aGUIParameterA, int aGUIParameterB, String aGUIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect, String aOverlays, Object[] aRecipe) { + super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase(Locale.ENGLISH) + "/OVERLAY_BOTTOM"))); + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; //TODO: CHECK if (aRecipe != null) { for (int i = 3; i < aRecipe.length; i++) { - if (aRecipe[i] == X.CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mManagingObject; continue; } - if (aRecipe[i] == X.BETTER_CIRCUIT) { - aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.BETTER_CIRCUIT) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mBetterManagingObject; continue; } - if (aRecipe[i] == X.HULL) { - aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mHullObject; continue; } - if (aRecipe[i] == X.WIRE) { - aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mConductingObject; continue; } - if (aRecipe[i] == X.WIRE4) { - aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject; + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4) { + aRecipe[i] = Tier.ELECTRIC[this.mTier].mLargerConductingObject; continue; } - if (aRecipe[i] == X.GLASS) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.GLASS) { + switch (this.mTier) { + case 0: + case 1: + case 2: + case 3: + aRecipe[i] = new ItemStack(Blocks.glass, 1, W); + break; + case 4: + case 5: case 6: case 7: case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - aRecipe[i] = Ic2Items.reinforcedGlass; - break; + if (Loader.isModLoaded("bartworks")) { + aRecipe[i] = "blockGlass"+VN[aTier]; + break; + } default: - aRecipe[i] = new ItemStack(Blocks.glass, 1, W); - break; + if (Loader.isModLoaded("bartworks")) { + aRecipe[i] = "blockGlass"+VN[8]; + break; + } else { + aRecipe[i] = Ic2Items.reinforcedGlass; + break; + } } continue; } - if (aRecipe[i] == X.PLATE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PLATE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.plate.get(Materials.Steel); @@ -120,9 +125,6 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = OrePrefixes.plate.get(Materials.HSSE); break; - case 8: - aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); - break; default: aRecipe[i] = OrePrefixes.plate.get(Materials.Neutronium); break; @@ -130,8 +132,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.PIPE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PIPE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze); @@ -158,14 +160,14 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.pipeLarge.get(Materials.Ultimate); break; default: - aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Ultimate); + aRecipe[i] = OrePrefixes.pipeHuge.get(Materials.Ultimate); break; } continue; } - if (aRecipe[i] == X.COIL_HEATING) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper); @@ -191,6 +193,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.NaquadahAlloy); break; + case 9: + aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); + break; default: aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); break; @@ -198,8 +203,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.COIL_HEATING_DOUBLE) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_HEATING_DOUBLE) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper); @@ -225,6 +230,9 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 8: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.NaquadahAlloy); break; + case 9: + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.NaquadahAlloy); + break; default: aRecipe[i] = OrePrefixes.wireGt16.get(Materials.NaquadahAlloy); break; @@ -232,8 +240,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_DISTILLATION) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_DISTILLATION) { + switch (this.mTier) { default: aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze); break; @@ -241,8 +249,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_MAGNETIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_MAGNETIC) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic); @@ -266,8 +274,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.STICK_ELECTROMAGNETIC) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron); @@ -286,10 +294,10 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.COIL_ELECTRIC) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.COIL_ELECTRIC) { + switch (this.mTier) { case 0: - aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin); + aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Lead); break; case 1: aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin); @@ -304,23 +312,23 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); break; case 5: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper); + aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper); break; case 6: aRecipe[i] = OrePrefixes.wireGt04.get(Materials.YttriumBariumCuprate); break; case 7: - aRecipe[i] = OrePrefixes.wireGt08.get(Materials.SuperconductorUHV); + aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Iridium); break; default: - aRecipe[i] = OrePrefixes.wireGt16.get(Materials.SuperconductorUHV); + aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Osmium); break; } continue; } - if (aRecipe[i] == X.ROBOT_ARM) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Robot_Arm_LV; @@ -343,15 +351,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Robot_Arm_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Robot_Arm_UV; break; + case 9: + aRecipe[i] = ItemList.Robot_Arm_UHV; + break; + default: + aRecipe[i] = ItemList.Robot_Arm_UEV; + break; } continue; } - if (aRecipe[i] == X.PUMP) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PUMP) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Pump_LV; @@ -374,15 +388,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Pump_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Pump_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Pump_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Pump_UEV; + break; } continue; } - if (aRecipe[i] == X.ROTOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROTOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin); @@ -412,8 +432,8 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ continue; } - if (aRecipe[i] == X.MOTOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.MOTOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Motor_LV; @@ -436,15 +456,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Motor_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Motor_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Motor_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Motor_UEV; + break; } continue; } - if (aRecipe[i] == X.PISTON) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Electric_Piston_LV; @@ -467,15 +493,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Electric_Piston_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Electric_Piston_UV; break; + case 9: + aRecipe[i] = ItemList.Electric_Piston_UHV; + break; + default: + aRecipe[i] = ItemList.Electric_Piston_UEV; + break; } continue; } - if (aRecipe[i] == X.CONVEYOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CONVEYOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Conveyor_Module_LV; @@ -498,15 +530,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Conveyor_Module_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Conveyor_Module_UV; break; + case 9: + aRecipe[i] = ItemList.Conveyor_Module_UHV; + break; + default: + aRecipe[i] = ItemList.Conveyor_Module_UEV; + break; } continue; } - if (aRecipe[i] == X.EMITTER) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.EMITTER) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Emitter_LV; @@ -529,15 +567,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Emitter_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Emitter_UV; break; + case 9: + aRecipe[i] = ItemList.Emitter_UHV; + break; + default: + aRecipe[i] = ItemList.Emitter_UEV; + break; } continue; } - if (aRecipe[i] == X.SENSOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.SENSOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Sensor_LV; @@ -560,15 +604,21 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Sensor_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Sensor_UV; break; + case 9: + aRecipe[i] = ItemList.Sensor_UHV; + break; + default: + aRecipe[i] = ItemList.Sensor_UEV; + break; } continue; } - if (aRecipe[i] == X.FIELD_GENERATOR) { - switch (mTier) { + if (aRecipe[i] == GT_MetaTileEntity_BasicMachine_GT_Recipe.X.FIELD_GENERATOR) { + switch (this.mTier) { case 0: case 1: aRecipe[i] = ItemList.Field_Generator_LV; @@ -591,50 +641,56 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ case 7: aRecipe[i] = ItemList.Field_Generator_ZPM; break; - default: + case 8: aRecipe[i] = ItemList.Field_Generator_UV; break; + case 9: + aRecipe[i] = ItemList.Field_Generator_UHV; + break; + default: + aRecipe[i] = ItemList.Field_Generator_UEV; + break; } continue; } - if (aRecipe[i] instanceof X) + if (aRecipe[i] instanceof GT_MetaTileEntity_BasicMachine_GT_Recipe.X) throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier); } - if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) { + if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE | GT_ModHandler.RecipeBits.REVERSIBLE, aRecipe)) { throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName()); } } } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; } - public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { + public GT_MetaTileEntity_BasicMachine_GT_Recipe(String aName, int aTier, String[] aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) { super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName); - mSharedTank = aSharedTank; - mTankCapacity = aTankCapacity; - mSpecialEffect = aSpecialEffect; - mRequiresFluidForFiltering = aRequiresFluidForFiltering; - mRecipes = aRecipes; - mSound = aSound; - mGUIParameterA = (byte) aGUIParameterA; - mGUIParameterB = (byte) aGUIParameterB; + this.mSharedTank = aSharedTank; + this.mTankCapacity = aTankCapacity; + this.mSpecialEffect = aSpecialEffect; + this.mRequiresFluidForFiltering = aRequiresFluidForFiltering; + this.mRecipes = aRecipes; + this.mSound = aSound; + this.mGUIParameterA = (byte) aGUIParameterA; + this.mGUIParameterB = (byte) aGUIParameterB; } @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicMachine_GT_Recipe(mName, mTier, mDescriptionArray, mRecipes, mInputSlotCount, mOutputItems == null ? 0 : mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect); + return new GT_MetaTileEntity_BasicMachine_GT_Recipe(this.mName, this.mTier, this.mDescriptionArray, this.mRecipes, this.mInputSlotCount, this.mOutputItems == null ? 0 : this.mOutputItems.length, this.mTankCapacity, this.mAmperage, this.mGUIParameterA, this.mGUIParameterB, this.mTextures, this.mGUIName, this.mNEIName, this.mSound, this.mSharedTank, this.mRequiresFluidForFiltering, this.mSpecialEffect); } @Override @@ -644,22 +700,22 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB); + return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), this.mGUIName, GT_Utility.isStringValid(this.mNEIName) ? this.mNEIName : this.getRecipeList() != null ? this.getRecipeList().mUnlocalizedName : "", this.mGUIParameterA, this.mGUIParameterB); } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false; - if (mInventory[aIndex] != null) return true; - switch (mInputSlotCount) { + if (this.mInventory[aIndex] != null) return true; + switch (this.mInputSlotCount) { case 0: return false; case 1: - return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), new ItemStack[]{aStack}); + return this.getFillableStack() == null ? !this.mRequiresFluidForFiltering && this.getRecipeList().containsInput(aStack) : null != this.getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, true, V[this.mTier], new FluidStack[]{this.getFillableStack()}, this.getSpecialSlot(), new ItemStack[]{aStack}); case 2: - return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0) != null && getInputAt(1) != null) || (getInputAt(0) == null && getInputAt(1) == null ? getRecipeList().containsInput(aStack) : (getRecipeList().containsInput(aStack) && null != getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[]{aStack, getInputAt(1)} : new ItemStack[]{getInputAt(0), aStack}))))); + return (!this.mRequiresFluidForFiltering || this.getFillableStack() != null) && (((this.getInputAt(0) != null && this.getInputAt(1) != null) || (this.getInputAt(0) == null && this.getInputAt(1) == null ? this.getRecipeList().containsInput(aStack) : (this.getRecipeList().containsInput(aStack) && null != this.getRecipeList().findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe, true, V[this.mTier], new FluidStack[]{this.getFillableStack()}, this.getSpecialSlot(), aIndex == this.getInputSlot() ? new ItemStack[]{aStack, this.getInputAt(1)} : new ItemStack[]{this.getInputAt(0), aStack}))))); default:{ - int tID = getBaseMetaTileEntity().getMetaTileID(); + int tID = this.getBaseMetaTileEntity().getMetaTileID(); if (tID >= 211 && tID <= 218 || tID >= 1180 && tID <= 1187 || tID >= 10780 && tID <= 10786) {//assembler lv-iv; circuit asseblers lv - uv; assemblers luv-uev if (GT_Utility.isStackValid(aStack)) for (int oreID : OreDictionary.getOreIDs(aStack)) { @@ -667,7 +723,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ return true; } } - return getRecipeList().containsInput(aStack); + return this.getRecipeList().containsInput(aStack); } } @@ -678,7 +734,7 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { - switch (mSpecialEffect) { + switch (this.mSpecialEffect) { case 0: break; case 1: @@ -692,27 +748,27 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ } @Override - public GT_Recipe_Map getRecipeList() { - return mRecipes; + public GT_Recipe.GT_Recipe_Map getRecipeList() { + return this.mRecipes; } @Override public int getCapacity() { - return mTankCapacity; + return this.mTankCapacity; } @Override public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == 1 && GT_Utility.isStringValid(mSound)) GT_Utility.doSoundAtClient(mSound, 100, 1.0F, aX, aY, aZ); + if (aIndex == 1 && GT_Utility.isStringValid(this.mSound)) GT_Utility.doSoundAtClient(this.mSound, 100, 1.0F, aX, aY, aZ); } @Override public void startProcess() { - BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity)getBaseMetaTileEntity()); + BaseMetaTileEntity myMetaTileEntity = ((BaseMetaTileEntity) this.getBaseMetaTileEntity()); // Added to throttle sounds. To reduce lag, this is on the server side so BlockUpdate packets aren't sent. if (myMetaTileEntity.mTickTimer > (myMetaTileEntity.mLastSoundTick+ticksBetweenSounds)) { - if (GT_Utility.isStringValid(mSound)) sendLoopStart((byte) 1); + if (GT_Utility.isStringValid(this.mSound)) this.sendLoopStart((byte) 1); // Does not have overflow protection, but they are longs. myMetaTileEntity.mLastSoundTick = myMetaTileEntity.mTickTimer; } @@ -720,18 +776,18 @@ public class GT_MetaTileEntity_BasicMachine_GT_Recipe extends GT_MetaTileEntity_ @Override public FluidStack getFillableStack() { - return mSharedTank ? getDrainableStack() : super.getFillableStack(); + return this.mSharedTank ? this.getDrainableStack() : super.getFillableStack(); } @Override public FluidStack setFillableStack(FluidStack aFluid) { - return mSharedTank ? setDrainableStack(aFluid) : super.setFillableStack(aFluid); + return this.mSharedTank ? this.setDrainableStack(aFluid) : super.setFillableStack(aFluid); } @Override protected boolean displaysOutputFluid() { - return !mSharedTank; + return !this.mSharedTank; } - public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC} + public enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC} } -- cgit