From 7d1f51a8937e0a86486267437d444696e81e8aa0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:04:28 +0200 Subject: Buildscript + Spotless (#318) * Convert AES.java to readable class * Buildscript * Spotless --- .../GT_MetaTileEntity_BasicBreaker.java | 539 +- ...GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java | 140 +- .../GT_MetaTileEntity_Dehydrator.java | 282 +- .../GT_MetaTileEntity_DeluxeMachine.java | 371 +- .../GT_MetaTileEntity_DeluxeTank.java | 693 +-- .../GT_MetaTileEntity_Hatch_AirIntake.java | 204 +- .../GT_MetaTileEntity_Hatch_AirIntake_Extreme.java | 46 +- .../GT_MetaTileEntity_Hatch_ControlCore.java | 96 +- .../GT_MetaTileEntity_Hatch_DynamoBuffer.java | 131 +- ...etaTileEntity_Hatch_ElementalDataOrbHolder.java | 318 +- .../GT_MetaTileEntity_Hatch_Energy_RTG.java | 547 +- .../GT_MetaTileEntity_Hatch_FluidGenerator.java | 420 +- .../GT_MetaTileEntity_Hatch_InputBattery.java | 366 +- .../GT_MetaTileEntity_Hatch_Muffler_Adv.java | 614 +-- .../GT_MetaTileEntity_Hatch_Naquadah.java | 385 +- .../GT_MetaTileEntity_Hatch_OutputBattery.java | 427 +- .../GT_MetaTileEntity_Hatch_Plasma.java | 395 +- .../GT_MetaTileEntity_Hatch_Reservoir.java | 205 +- .../GT_MetaTileEntity_Hatch_Steam_BusInput.java | 505 +- .../GT_MetaTileEntity_Hatch_Steam_BusOutput.java | 124 +- .../GT_MetaTileEntity_Hatch_Turbine.java | 757 +-- .../GT_MetaTileEntity_Hatch_TurbineProvider.java | 382 +- .../GT_MetaTileEntity_SuperBus_Input.java | 258 +- .../GT_MetaTileEntity_SuperBus_Output.java | 326 +- .../GregtechMetaPipeEntityFluid.java | 250 +- .../GregtechMetaPipeEntity_Cable.java | 422 +- .../GregtechMetaTreeFarmerStructural.java | 99 +- .../implementations/base/CustomMetaTileBase.java | 74 +- .../GT_MetaTileEntity_Hatch_CustomFluidBase.java | 354 +- .../base/GregtechMetaPipeEntityBase_Cable.java | 964 ++-- .../base/GregtechMetaTileEntity.java | 125 +- .../base/GregtechMetaTransformerHiAmp.java | 221 +- .../base/GregtechMeta_MultiBlockBase.java | 5494 ++++++++++---------- .../base/GregtechMeta_SteamMultiBase.java | 1318 ++--- .../GregtechDoubleFuelGeneratorBase.java | 861 +-- .../base/generators/GregtechMetaBoilerBase.java | 713 ++- .../generators/GregtechMetaSolarGenerator.java | 441 +- .../GregtechRocketFuelGeneratorBase.java | 731 +-- .../base/machines/GregtechMetaSafeBlockBase.java | 572 +- .../base/machines/GregtechMetaTreeFarmerBase.java | 355 +- .../GT_MetaTileEntity_Hatch_Catalysts.java | 60 +- .../GT_MetaTileEntity_Hatch_MillingBalls.java | 60 +- .../GT_MetaTileEntity_Hatch_NbtConsumable.java | 559 +- 43 files changed, 11691 insertions(+), 10513 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java index 3821b2a95c..ac069be52d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java @@ -21,265 +21,282 @@ import net.minecraft.util.EnumChatFormatting; public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock { - public boolean mCharge = false; - public boolean mDecharge = false; - public int mBatteryCount = 0; - public int mChargeableCount = 0; - private long count = 0L; - private long mStored = 0L; - private long mMax = 0L; - - public GT_MetaTileEntity_BasicBreaker(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { - super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]); - } - - public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { - super(aName, aTier, aSlotCount, aDescription, aTextures); - } - - public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { - super(aName, aTier, aSlotCount, aDescription, aTextures); - } - - public String[] getDescription() { - final String[] desc = new String[6]; - int tTier = this.mTier; - desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots"; - desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"; - desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" + EnumChatFormatting.GRAY + " be in a single Amp"; - desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)] + " as a result"; - desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY + " EU/t"; - desc[5] = CORE.GT_Tooltip; - return desc; - } - - public ITexture[][][] getTextureSet(ITexture[] aTextures) { - ITexture[][][] rTextures = new ITexture[2][17][]; - - for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i - + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]}; - - rTextures[1][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i - + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; - } - - return rTextures; - } - - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; - } - - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length); - } - - public boolean isSimpleMachine() { - return false; - } - - public boolean isElectric() { - return true; - } - - public boolean isValidSlot(int aIndex) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return true; - } - - public boolean isEnetInput() { - return true; - } - - public boolean isEnetOutput() { - return true; - } - - public boolean isInputFacing(byte aSide) { - return aSide != this.getBaseMetaTileEntity().getFrontFacing(); - } - - public boolean isOutputFacing(byte aSide) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing(); - } - - public boolean isTeleporterCompatible() { - return false; - } - - public long getMinimumStoredEU() { - return GT_Values.V[this.mTier] * 16L * 16; - } - - public long maxEUStore() { - return GT_Values.V[this.mTier] * 64L * 16; - } - - public long maxEUInput() { - return GT_Values.V[this.mTier] * 16; - } - - public long maxEUOutput() { - return GT_Values.V[this.mTier]; - } - - public long maxAmperesIn() { - return 16; - } - - public long maxAmperesOut() { - return 16; - } - - public int rechargerSlotStartIndex() { - return 0; - } - - public int dechargerSlotStartIndex() { - return 0; - } - - public int rechargerSlotCount() { - return 0; - } - - public int dechargerSlotCount() { - return 0; - } - - public int getProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); - } - - public int maxProgresstime() { - return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); - } - - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - public void saveNBTData(NBTTagCompound aNBT) { - } - - public void loadNBTData(NBTTagCompound aNBT) { - } - - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) { - return true; - } - else { - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } - } - - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); - } - - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (aBaseMetaTileEntity.isServerSide()) { - /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; - this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; - this.mBatteryCount = 0; - this.mChargeableCount = 0; - ItemStack[] arg3 = this.mInventory; - int arg4 = arg3.length; - - for (int arg5 = 0; arg5 < arg4; ++arg5) { - ItemStack tStack = arg3[arg5]; - if (GT_ModHandler.isElectricItem(tStack, this.mTier)) { - if (GT_ModHandler.isChargerItem(tStack)) { - ++this.mBatteryCount; - } - - ++this.mChargeableCount; - } - }*/ - } - - } - - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return false; - } - - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return true; - } - - public int getInventoryStackLimit() { - return 1; - } - - public long[] getStoredEnergy() { - boolean scaleOverflow = false; - boolean storedOverflow = false; - long tScale = this.getBaseMetaTileEntity().getEUCapacity(); - long tStored = this.getBaseMetaTileEntity().getStoredEU(); - long tStep = 0L; - if (this.mInventory != null) { - ItemStack[] arg8 = this.mInventory; - int arg9 = arg8.length; - - for (int arg10 = 0; arg10 < arg9; ++arg10) { - ItemStack aStack = arg8[arg10]; - if (GT_ModHandler.isElectricItem(aStack)) { - if (aStack.getItem() instanceof GT_MetaBase_Item) { - Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); - if (stats != null) { - if (stats[0].longValue() > 4611686018427387903L) { - scaleOverflow = true; - } - - tScale += stats[0].longValue(); - tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); - if (tStep > 4611686018427387903L) { - storedOverflow = true; - } - - tStored += tStep; - } - } - else if (aStack.getItem() instanceof IElectricItem) { - tStored += (long) ElectricItem.manager.getCharge(aStack); - tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); - } - } - } - } - - if (scaleOverflow) { - tScale = Long.MAX_VALUE; - } - - if (storedOverflow) { - tStored = Long.MAX_VALUE; - } - - return new long[]{tStored, tScale}; - } - - public String[] getInfoData() { - return new String[]{"Tile Type: " + this.getTileEntityBaseType()}; - } - - public boolean isGivingInformation() { - return true; - } - - public boolean doesExplode() { - return true; - } + public boolean mCharge = false; + public boolean mDecharge = false; + public int mBatteryCount = 0; + public int mChargeableCount = 0; + private long count = 0L; + private long mStored = 0L; + private long mMax = 0L; + + public GT_MetaTileEntity_BasicBreaker( + int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { + super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]); + } + + public GT_MetaTileEntity_BasicBreaker( + String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_BasicBreaker( + String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { + super(aName, aTier, aSlotCount, aDescription, aTextures); + } + + public String[] getDescription() { + final String[] desc = new String[6]; + int tTier = this.mTier; + desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots"; + desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier]) + + EnumChatFormatting.GRAY + " EU/t"; + desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" + + EnumChatFormatting.GRAY + " be in a single Amp"; + desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)] + + " as a result"; + desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY + + " EU/t"; + desc[5] = CORE.GT_Tooltip; + return desc; + } + + public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[2][17][]; + + for (byte i = -1; i < 16; ++i) { + rTextures[0][i + 1] = new ITexture[] { + BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + this.mInventory.length > 4 + ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] + : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)] + }; + + rTextures[1][i + 1] = new ITexture[] { + BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], + this.mInventory.length > 4 + ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] + : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] + }; + } + + return rTextures; + } + + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BasicBreaker( + this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length); + } + + public boolean isSimpleMachine() { + return false; + } + + public boolean isElectric() { + return true; + } + + public boolean isValidSlot(int aIndex) { + return true; + } + + public boolean isFacingValid(byte aFacing) { + return true; + } + + public boolean isEnetInput() { + return true; + } + + public boolean isEnetOutput() { + return true; + } + + public boolean isInputFacing(byte aSide) { + return aSide != this.getBaseMetaTileEntity().getFrontFacing(); + } + + public boolean isOutputFacing(byte aSide) { + return aSide == this.getBaseMetaTileEntity().getFrontFacing(); + } + + public boolean isTeleporterCompatible() { + return false; + } + + public long getMinimumStoredEU() { + return GT_Values.V[this.mTier] * 16L * 16; + } + + public long maxEUStore() { + return GT_Values.V[this.mTier] * 64L * 16; + } + + public long maxEUInput() { + return GT_Values.V[this.mTier] * 16; + } + + public long maxEUOutput() { + return GT_Values.V[this.mTier]; + } + + public long maxAmperesIn() { + return 16; + } + + public long maxAmperesOut() { + return 16; + } + + public int rechargerSlotStartIndex() { + return 0; + } + + public int dechargerSlotStartIndex() { + return 0; + } + + public int rechargerSlotCount() { + return 0; + } + + public int dechargerSlotCount() { + return 0; + } + + public int getProgresstime() { + return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored(); + } + + public int maxProgresstime() { + return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity(); + } + + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + public void saveNBTData(NBTTagCompound aNBT) {} + + public void loadNBTData(NBTTagCompound aNBT) {} + + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } else { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + } + + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName()); + } + + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (aBaseMetaTileEntity.isServerSide()) { + /*this.mCharge = aBaseMetaTileEntity.getStoredEU() / 2L > aBaseMetaTileEntity.getEUCapacity() / 3L; + this.mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3L; + this.mBatteryCount = 0; + this.mChargeableCount = 0; + ItemStack[] arg3 = this.mInventory; + int arg4 = arg3.length; + + for (int arg5 = 0; arg5 < arg4; ++arg5) { + ItemStack tStack = arg3[arg5]; + if (GT_ModHandler.isElectricItem(tStack, this.mTier)) { + if (GT_ModHandler.isChargerItem(tStack)) { + ++this.mBatteryCount; + } + + ++this.mChargeableCount; + } + }*/ + } + } + + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + public int getInventoryStackLimit() { + return 1; + } + + public long[] getStoredEnergy() { + boolean scaleOverflow = false; + boolean storedOverflow = false; + long tScale = this.getBaseMetaTileEntity().getEUCapacity(); + long tStored = this.getBaseMetaTileEntity().getStoredEU(); + long tStep = 0L; + if (this.mInventory != null) { + ItemStack[] arg8 = this.mInventory; + int arg9 = arg8.length; + + for (int arg10 = 0; arg10 < arg9; ++arg10) { + ItemStack aStack = arg8[arg10]; + if (GT_ModHandler.isElectricItem(aStack)) { + if (aStack.getItem() instanceof GT_MetaBase_Item) { + Long[] stats = ((GT_MetaBase_Item) aStack.getItem()).getElectricStats(aStack); + if (stats != null) { + if (stats[0].longValue() > 4611686018427387903L) { + scaleOverflow = true; + } + + tScale += stats[0].longValue(); + tStep = ((GT_MetaBase_Item) aStack.getItem()).getRealCharge(aStack); + if (tStep > 4611686018427387903L) { + storedOverflow = true; + } + + tStored += tStep; + } + } else if (aStack.getItem() instanceof IElectricItem) { + tStored += (long) ElectricItem.manager.getCharge(aStack); + tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); + } + } + } + } + + if (scaleOverflow) { + tScale = Long.MAX_VALUE; + } + + if (storedOverflow) { + tStored = Long.MAX_VALUE; + } + + return new long[] {tStored, tScale}; + } + + public String[] getInfoData() { + return new String[] {"Tile Type: " + this.getTileEntityBaseType()}; + } + + public boolean isGivingInformation() { + return true; + } + + public boolean doesExplode() { + return true; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java index 18665538d0..cf92bdc0ba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine_GTPP_Recipe.java @@ -5,34 +5,120 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.util.GT_Recipe.GT_Recipe_Map; public class GT_MetaTileEntity_BasicMachine_GTPP_Recipe extends GT_MetaTileEntity_BasicMachine_GT_Recipe { - - public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity, - aGUIParameterA, aGUIParameterB, aGUIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect, - aOverlays, aRecipe); - } - public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription, aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA, - aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect); - } - - public GT_MetaTileEntity_BasicMachine_GTPP_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, aDescription[0], aRecipes, aInputSlots, aOutputSlots, aTankCapacity, aAmperage, aGUIParameterA, - aGUIParameterB, aTextures, aGUIName, aNEIName, aSound, aSharedTank, aRequiresFluidForFiltering, aSpecialEffect); - } + public GT_MetaTileEntity_BasicMachine_GTPP_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, + aDescription, + aRecipes, + aInputSlots, + aOutputSlots, + aTankCapacity, + aGUIParameterA, + aGUIParameterB, + aGUIName, + aSound, + aSharedTank, + aRequiresFluidForFiltering, + aSpecialEffect, + aOverlays, + aRecipe); + } - - - + public GT_MetaTileEntity_BasicMachine_GTPP_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, + aDescription, + aRecipes, + aInputSlots, + aOutputSlots, + aTankCapacity, + aAmperage, + aGUIParameterA, + aGUIParameterB, + aTextures, + aGUIName, + aNEIName, + aSound, + aSharedTank, + aRequiresFluidForFiltering, + aSpecialEffect); + } + public GT_MetaTileEntity_BasicMachine_GTPP_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, + aDescription[0], + aRecipes, + aInputSlots, + aOutputSlots, + aTankCapacity, + aAmperage, + aGUIParameterA, + aGUIParameterB, + aTextures, + aGUIName, + aNEIName, + aSound, + aSharedTank, + aRequiresFluidForFiltering, + aSpecialEffect); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java index aebf188fc0..02f0a3ff40 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java @@ -19,51 +19,105 @@ import gtPlusPlus.core.lib.CORE; @SuppressWarnings("deprecation") public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine_GT_Recipe { - private static final CustomIcon[] sDehydratorOverlays = new CustomIcon[10]; - static { - sDehydratorOverlays[0] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT"); - sDehydratorOverlays[2] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM"); - sDehydratorOverlays[3] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE"); - sDehydratorOverlays[4] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT"); - sDehydratorOverlays[5] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE"); - sDehydratorOverlays[7] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM_ACTIVE"); - sDehydratorOverlays[8] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE_ACTIVE"); - sDehydratorOverlays[9] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT_ACTIVE"); - //3 8 - } - + private static final CustomIcon[] sDehydratorOverlays = new CustomIcon[10]; + + static { + sDehydratorOverlays[0] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT"); + sDehydratorOverlays[2] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM"); + sDehydratorOverlays[3] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE"); + sDehydratorOverlays[4] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT"); + sDehydratorOverlays[5] = new CustomIcon("basicmachines/microwave/OVERLAY_FRONT_ACTIVE"); + sDehydratorOverlays[7] = new CustomIcon("basicmachines/plasma_arc_furnace/OVERLAY_BOTTOM_ACTIVE"); + sDehydratorOverlays[8] = new CustomIcon("basicmachines/fluid_heater/OVERLAY_SIDE_ACTIVE"); + sDehydratorOverlays[9] = new CustomIcon("basicmachines/chemical_bath/OVERLAY_FRONT_ACTIVE"); + // 3 8 + } + private GT_Recipe_Map xRecipes; - private int xTankCapacity; + private int xTankCapacity; + + public GT_MetaTileEntity_Dehydrator( + int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) { + super( + aID, + aName, + aNameRegional, + aTier, + aDescription, + GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, + 2, + 9, + aTankCapacity, + 2, + 5, + "Dehydrator.png", + "UNBOXINATOR", + false, + false, + 0, + "", + null); + xRecipes = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes; + xTankCapacity = aTankCapacity; + } - public GT_MetaTileEntity_Dehydrator(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aTankCapacity) { - super(aID, aName, aNameRegional, aTier, aDescription, GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes, 2, 9, aTankCapacity, 2, 5, "Dehydrator.png", "UNBOXINATOR", false, false, 0, "", null); - xRecipes = GTPP_Recipe.GTPP_Recipe_Map.sChemicalDehydratorRecipes; - xTankCapacity = aTankCapacity; - } + public GT_MetaTileEntity_Dehydrator( + String aName, + int aTier, + String[] aDescription, + GT_Recipe.GT_Recipe_Map aRecipes, + int aTankCapacity, + int aAmperage, + ITexture[][][] aTextures, + String aGUIName, + String aNEIName) { + super( + aName, + aTier, + aDescription, + aRecipes, + 2, + 9, + aTankCapacity, + aAmperage, + 2, + 5, + aTextures, + aGUIName, + aNEIName, + "", + false, + false, + 0); + } - public GT_MetaTileEntity_Dehydrator(String aName, int aTier, String[] aDescription, GT_Recipe.GT_Recipe_Map aRecipes, int aTankCapacity, int aAmperage, ITexture[][][] aTextures, String aGUIName, String aNEIName) { - super(aName, aTier, aDescription, aRecipes, 2, 9, aTankCapacity, aAmperage, 2, 5, aTextures, aGUIName, aNEIName, "", false, false, 0); - + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Dehydrator( + this.mName, + this.mTier, + this.mDescriptionArray, + this.xRecipes, + this.xTankCapacity, + this.mAmperage, + this.mTextures, + this.mGUIName, + this.mNEIName); } @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Dehydrator(this.mName, this.mTier, this.mDescriptionArray, this.xRecipes, this.xTankCapacity, this.mAmperage, this.mTextures, this.mGUIName, this.mNEIName); + public String[] getDescription() { + String[] S = super.getDescription(); + final String[] desc = new String[S.length + 1]; + System.arraycopy(S, 0, desc, 0, S.length); + desc[S.length] = CORE.GT_Tooltip; + return desc; } - - @Override - public String[] getDescription() { - String[] S = super.getDescription(); - final String[] desc = new String[S.length + 1]; - System.arraycopy(S, 0, desc, 0, S.length); - desc[S.length] = CORE.GT_Tooltip; - return desc; - } - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[15][17][]; - for (byte i = -1; i < 16; i++) { + @Override + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + final ITexture[][][] rTextures = new ITexture[15][17][]; + for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = getSideFacingActive(i); rTextures[1][i + 1] = getSideFacingInactive(i); rTextures[2][i + 1] = getFrontFacingActive(i); @@ -71,93 +125,113 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine rTextures[4][i + 1] = getTopFacingActive(i); rTextures[5][i + 1] = getTopFacingInactive(i); rTextures[6][i + 1] = getBottomFacingActive(i); - rTextures[7][i + 1] = getBottomFacingInactive(i); + rTextures[7][i + 1] = getBottomFacingInactive(i); rTextures[8][i + 1] = getBottomFacingPipeActive(i); rTextures[9][i + 1] = getBottomFacingPipeInactive(i); rTextures[10][i + 1] = getTopFacingPipeActive(i); rTextures[11][i + 1] = getTopFacingPipeInactive(i); rTextures[12][i + 1] = getSideFacingPipeActive(i); rTextures[13][i + 1] = getSideFacingPipeInactive(i); - } - return rTextures; - } - - - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, aRedstone); - //return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; - } - - @Override - public ITexture[] getFrontFacingInactive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[0])}; - } - - @Override - public ITexture[] getBottomFacingInactive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[2])}; - } - - @Override - public ITexture[] getTopFacingInactive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[3])}; - } - - @Override - public ITexture[] getSideFacingInactive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[4])}; - } - - @Override - public ITexture[] getFrontFacingActive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[5])}; - } - - @Override - public ITexture[] getBottomFacingActive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[7])}; - } - - @Override - public ITexture[] getTopFacingActive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[8])}; - } - - @Override - public ITexture[] getSideFacingActive(final byte aColor) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[9])}; - } - - @Override + } + return rTextures; + } + + @Override + public ITexture[] getTexture( + final IGregTechTileEntity aBaseMetaTileEntity, + final byte aSide, + final byte aFacing, + final byte aColorIndex, + final boolean aActive, + final boolean aRedstone) { + return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, aRedstone); + // return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 : aSide == + // GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + } + + @Override + public ITexture[] getFrontFacingInactive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[0]) + }; + } + + @Override + public ITexture[] getBottomFacingInactive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[2]) + }; + } + + @Override + public ITexture[] getTopFacingInactive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[3]) + }; + } + + @Override + public ITexture[] getSideFacingInactive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[4]) + }; + } + + @Override + public ITexture[] getFrontFacingActive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[5]) + }; + } + + @Override + public ITexture[] getBottomFacingActive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[7]) + }; + } + + @Override + public ITexture[] getTopFacingActive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[8]) + }; + } + + @Override + public ITexture[] getSideFacingActive(final byte aColor) { + return new ITexture[] { + Textures.BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1], new GT_RenderedTexture(sDehydratorOverlays[9]) + }; + } + + @Override public ITexture[] getBottomFacingPipeActive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; } - @Override + @Override public ITexture[] getBottomFacingPipeInactive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; } - @Override + @Override public ITexture[] getTopFacingPipeActive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; } - @Override + @Override public ITexture[] getTopFacingPipeInactive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; } - @Override + @Override public ITexture[] getSideFacingPipeActive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; } - @Override + @Override public ITexture[] getSideFacingPipeInactive(byte aColor) { - return new ITexture[]{MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; - } - + return new ITexture[] {MACHINE_CASINGS[mTier][aColor + 1], TextureFactory.of(OVERLAY_PIPE_OUT)}; + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java index 79238240d2..007e6a1761 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java @@ -2,14 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import static gregtech.api.enums.GT_Values.V; -import java.util.Arrays; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - import gregtech.api.GregTech_API; import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; @@ -23,9 +15,14 @@ import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.random.XSTR; +import java.util.Arrays; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; @@ -41,14 +38,20 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ /** * return values for checkRecipe() */ - protected static final int - DID_NOT_FIND_RECIPE = 0, + protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; + public static final int OTHER_SLOT_COUNT = 4; public final ItemStack[] mOutputItems; public final int mInputSlotCount, mAmperage; - public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false; + public boolean mAllowInputFromOutputSide = false, + mFluidTransfer = false, + mItemTransfer = false, + mHasBeenUpdated = false, + mStuttering = false, + mCharge = false, + mDecharge = false; public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0; public FluidStack mOutputFluid; public String mGUIName = "", mNEIName = ""; @@ -56,6 +59,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered */ protected GT_Recipe mLastRecipe = null; + private FluidStack mFluidOut; /** @@ -75,8 +79,26 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ * 12 = SideFacingPipeActive * 13 = SideFacingPipeInactive */ - public GT_MetaTileEntity_DeluxeMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) { - super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays); + public GT_MetaTileEntity_DeluxeMachine( + int aID, + String aName, + String aNameRegional, + int aTier, + int aAmperage, + String aDescription, + int aInputSlotCount, + int aOutputSlotCount, + String aGUIName, + String aNEIName, + ITexture... aOverlays) { + super( + aID, + aName, + aNameRegional, + aTier, + OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, + aDescription, + aOverlays); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; mAmperage = aAmperage; @@ -84,7 +106,16 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mNEIName = aNEIName; } - public GT_MetaTileEntity_DeluxeMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) { + public GT_MetaTileEntity_DeluxeMachine( + String aName, + int aTier, + int aAmperage, + String aDescription, + ITexture[][][] aTextures, + int aInputSlotCount, + int aOutputSlotCount, + String aGUIName, + String aNEIName) { super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures); mInputSlotCount = Math.max(0, aInputSlotCount); mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)]; @@ -92,15 +123,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ mGUIName = aGUIName; mNEIName = aNEIName; } - - public boolean setMainFacing(byte aDirection){ - mMainFacing = aDirection; - if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){ - getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection)); - } + + public boolean setMainFacing(byte aDirection) { + mMainFacing = aDirection; + if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) { + getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection)); + } onFacingChange(); onMachineBlockUpdate(); - return true; + return true; } @Override @@ -109,10 +140,12 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ aTextures = Arrays.copyOf(aTextures, 14); for (int i = 0; i < aTextures.length; i++) - if (aTextures[i] != null) for (byte c = -1; c < 16; c++) { - if (rTextures[i][c + 1] == null) - rTextures[i][c + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]}; - } + if (aTextures[i] != null) + for (byte c = -1; c < 16; c++) { + if (rTextures[i][c + 1] == null) + rTextures[i][c + 1] = + new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]}; + } for (byte c = -1; c < 16; c++) { if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c); @@ -134,8 +167,28 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return mTextures[mMainFacing < 2 ? aSide == aFacing ? aActive ? 2 : 3 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 : aSide == mMainFacing ? aActive ? 2 : 3 : (showPipeFacing() && aSide == aFacing) ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1]; + public ITexture[] getTexture( + IGregTechTileEntity aBaseMetaTileEntity, + byte aSide, + byte aFacing, + byte aColorIndex, + boolean aActive, + boolean aRedstone) { + return mTextures[ + mMainFacing < 2 + ? aSide == aFacing + ? aActive ? 2 : 3 + : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 + : aSide == mMainFacing + ? aActive ? 2 : 3 + : (showPipeFacing() && aSide == aFacing) + ? aSide == 0 + ? aActive ? 8 : 9 + : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 + : aSide == 0 + ? aActive ? 6 : 7 + : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][ + aColorIndex + 1]; } @Override @@ -160,7 +213,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isValidSlot(int aIndex) { - return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; + return aIndex > 0 + && super.isValidSlot(aIndex) + && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length; } @Override @@ -190,7 +245,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isLiquidInput(byte aSide) { - return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing()); + return aSide != mMainFacing + && (mAllowInputFromOutputSide + || aSide != getBaseMetaTileEntity().getFrontFacing()); } @Override @@ -281,7 +338,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean isFluidInputAllowed(FluidStack aFluid) { - return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); + return getFillableStack() != null + || (getRecipeList() != null && getRecipeList().containsInput(aFluid)); } @Override @@ -338,17 +396,17 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) return true; - if(!false) { - aBaseMetaTileEntity.openGUI(aPlayer); - return true; + if (!false) { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; } - for(byte i=0;i < 6; i++){ - if(aBaseMetaTileEntity.getAirAtSide(i)){ - aBaseMetaTileEntity.openGUI(aPlayer); - return true; - } + for (byte i = 0; i < 6; i++) { + if (aBaseMetaTileEntity.getAirAtSide(i)) { + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } } - GT_Utility.sendChatToPlayer(aPlayer,"No free Side!"); + GT_Utility.sendChatToPlayer(aPlayer, "No free Side!"); return true; } @@ -359,7 +417,14 @@ public abstract class GT_MetaTileEntity_DeluxeMachine 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 : ""); + return new GT_GUIContainer_BasicMachine( + aPlayerInventory, + aBaseMetaTileEntity, + getLocalName(), + mGUIName, + GT_Utility.isStringValid(mNEIName) + ? mNEIName + : getRecipeList() != null ? getRecipeList().mUnlocalizedName : ""); } @Override @@ -408,8 +473,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - - //Utils.LOG_WARNING("Ticking Tank."); + + // Utils.LOG_WARNING("Ticking Tank."); mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3; mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3; @@ -423,8 +488,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (++mProgresstime >= mMaxProgresstime) { for (int i = 0; i < mOutputItems.length; i++) for (int j = 0; j < mOutputItems.length; j++) - if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) - break; + if (aBaseMetaTileEntity.addStackToSlot( + getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break; if (mOutputFluid != null) if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy()); else if (mOutputFluid.isFluidEqual(getDrainableStack())) @@ -440,7 +505,15 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } if (mProgresstime > 5) mStuttering = false; XSTR aXSTR = new XSTR(); - if(false && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord()); + if (false && aXSTR.nextInt(5000) == 0) + GT_Utility.sendSoundToPlayers( + aBaseMetaTileEntity.getWorld(), + GregTech_API.sSoundList.get(5), + 10.0F, + -1.0F, + aBaseMetaTileEntity.getXCoord(), + aBaseMetaTileEntity.getYCoord(), + aBaseMetaTileEntity.getZCoord()); } else { if (!mStuttering) { stutterProcess(); @@ -455,46 +528,80 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ boolean tRemovedOutputFluid = false; Logger.WARNING("R0"); - if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) { + if (doesAutoOutputFluids() + && getDrainableStack() != null + && aBaseMetaTileEntity.getFrontFacing() != mMainFacing + && (tSucceeded || aTick % 20 == 0)) { IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing()); if (tTank != null) { FluidStack tDrained = drain(1000, false); if (tDrained != null) { - int tFilledAmount = tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); + int tFilledAmount = tTank.fill( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false); if (tFilledAmount > 0) - tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true); + tTank.fill( + ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), + drain(tFilledAmount, true), + true); } } if (getDrainableStack() == null) tRemovedOutputFluid = true; } - if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) { + if (doesAutoOutput() + && !isOutputEmpty() + && aBaseMetaTileEntity.getFrontFacing() != mMainFacing + && (tSucceeded + || mOutputBlocked % 300 == 1 + || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600 == 0)) { TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing()); - for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) { - tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + for (int i = 0, tCosts = 1; + i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); + i++) { + tCosts = GT_Utility.moveOneItemStack( + aBaseMetaTileEntity, + tTileEntity2, + aBaseMetaTileEntity.getFrontFacing(), + aBaseMetaTileEntity.getBackFacing(), + null, + false, + (byte) 64, + (byte) 1, + (byte) 64, + (byte) 1); if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true); } } - if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0; - else mOutputBlocked++; + if (mOutputBlocked != 0) + if (isOutputEmpty()) mOutputBlocked = 0; + else mOutputBlocked++; Logger.WARNING("R1"); if (allowToCheckRecipe()) { Logger.WARNING("R2--------------------------------------------------"); - Logger.WARNING("R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())"); + Logger.WARNING( + "R2: (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe())"); Logger.WARNING("R2--------------------------------------------------"); - Logger.WARNING("R2-mMaxProgresstime: "+mMaxProgresstime); - Logger.WARNING("R2-isAllowedToWork(): "+aBaseMetaTileEntity.isAllowedToWork()); + Logger.WARNING("R2-mMaxProgresstime: " + mMaxProgresstime); + Logger.WARNING("R2-isAllowedToWork(): " + aBaseMetaTileEntity.isAllowedToWork()); Logger.WARNING("R2--------------------------------------------------"); - Logger.WARNING("R2-tRemovedOutputFluid: "+tRemovedOutputFluid); - Logger.WARNING("R2-tSucceeded: "+tSucceeded); - Logger.WARNING("R2-hasInventoryBeenModified(): "+aBaseMetaTileEntity.hasInventoryBeenModified()); - Logger.WARNING("R2-(aTick % 600 == 0): "+(aTick % 600 == 0)); - Logger.WARNING("R2-hasWorkJustBeenEnabled(): "+aBaseMetaTileEntity.hasWorkJustBeenEnabled()); + Logger.WARNING("R2-tRemovedOutputFluid: " + tRemovedOutputFluid); + Logger.WARNING("R2-tSucceeded: " + tSucceeded); + Logger.WARNING("R2-hasInventoryBeenModified(): " + aBaseMetaTileEntity.hasInventoryBeenModified()); + Logger.WARNING("R2-(aTick % 600 == 0): " + (aTick % 600 == 0)); + Logger.WARNING("R2-hasWorkJustBeenEnabled(): " + aBaseMetaTileEntity.hasWorkJustBeenEnabled()); Logger.WARNING("R2--------------------------------------------------"); - Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): "+hasEnoughEnergyToCheckRecipe()); + Logger.WARNING("R2-hasEnoughEnergyToCheckRecipe(): " + hasEnoughEnergyToCheckRecipe()); Logger.WARNING("R2--------------------------------------------------"); - if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) { + if (mMaxProgresstime <= 0 + && aBaseMetaTileEntity.isAllowedToWork() + && (tRemovedOutputFluid + || tSucceeded + || aBaseMetaTileEntity.hasInventoryBeenModified() + || aTick % 600 == 0 + || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) + && hasEnoughEnergyToCheckRecipe()) { Logger.WARNING("R3"); if (checkRecipe() == 2) { if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null; @@ -534,7 +641,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ } if (mMainFacing >= 2 && !mHasBeenUpdated) { mHasBeenUpdated = true; - //getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing()); + // getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing()); } if (displaysInputFluid()) { @@ -543,7 +650,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_ if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true)) mInventory[tDisplayStackSlot] = null; } else { - mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize()); + mInventory[tDisplayStackSlot] = + GT_Utility.getFluidDisplayStack(getFillable