From fbdbb388c369fae549cfde3eed38b536f7461d90 Mon Sep 17 00:00:00 2001 From: Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:03:23 +0100 Subject: Cleaning up (#767) * Kill playerAPI * Gut more events and compat that is now obsolete * Remove commented out code * Remove final modifier from methods * Make more stuff final * Remove slow building ring * Protected -> private in final classes * More cleaning * More cleaning v2 * Purging * Clean DevHelper * Clean DevHelper 2 * delete DevHelper * remove useless IFMLLoadingPlugin.MCVersion annotation from @Mod files * check for obfuscation only once in the IFMLloadingPlugin.injectData * don't instantiate the static class ASMConfig * delete unused and empty implementation of IFMLCallHook * delete empty class * delete ClassesToTransform class that just holds the class names constants * delete unused methods and unsless logging in dummymod container * delete unused transformer ClassTransformer_TT_ThaumicRestorer * spotless * Clean * Clean utils * Build checkpoint * Purge * Stage 2 * Stage 3 * Stage 4 * Stage 5 * Stage 6 * Spotless * Imports * Stage idk * Stage 1 * Fix issue * Spotless * Format numbers --------- Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Co-authored-by: Connor Colenso --- .../GT_MetaTileEntity_ElectricAutoWorkbench.java | 62 +- ...GT_MetaTileEntity_ElectricInventoryManager.java | 686 -------------------- .../GT_MetaTileEntity_TesseractGenerator.java | 15 +- .../GT_MetaTileEntity_TesseractTerminal.java | 15 +- .../generators/GT_MetaTileEntity_Boiler_Base.java | 2 - .../generators/GregtechMetaTileEntity_RTG.java | 26 +- .../ULV/GT_MetaTileEntity_ULV_GasTurbine.java | 65 -- .../basic/GT_MetaTileEntity_CropHarvestor.java | 45 +- .../GregtechMetaAtmosphericReconditioner.java | 47 +- .../machines/basic/GregtechMetaCondensor.java | 230 ------- .../basic/GregtechMetaPollutionCreator.java | 10 +- .../basic/GregtechMetaPollutionDetector.java | 19 +- .../basic/GregtechMetaTileEntityChunkLoader.java | 440 ------------- .../basic/GregtechMetaWirelessCharger.java | 4 +- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 3 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 3 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 3 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 15 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 2 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 3 +- .../processing/GregtechMetaTileEntity_IsaMill.java | 20 +- ...hMetaTileEntity_NuclearSaltProcessingPlant.java | 4 +- .../GregtechMetaTileEntity_SpargeTower.java | 4 +- ...egtechMetaTileEntity_Adv_DistillationTower.java | 16 +- .../GregtechMTE_ElementalDuplicator.java | 5 +- .../production/GregtechMetaTileEntityTreeFarm.java | 16 +- ...egtechMetaTileEntity_IndustrialFishingPond.java | 10 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 4 +- .../GregtechMetaTileEntity_SolarTower.java | 29 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 10 +- .../turbines/GT_MTE_LargeTurbine_Gas.java | 5 - .../turbines/GT_MTE_LargeTurbine_Plasma.java | 2 +- .../GregtechMetaTileEntity_LargerTurbineBase.java | 112 ++-- ...chMetaTileEntity_PowerSubStationController.java | 41 +- .../GT_MetaTileEntity_RedstoneButtonPanel.java | 73 +-- .../GT_MetaTileEntity_RedstoneCircuitBlock.java | 6 +- .../GT_MetaTileEntity_AdvancedCraftingTable.java | 693 --------------------- .../GT_MetaTileEntity_BronzeCraftingTable.java | 117 ---- .../storage/GT_MetaTileEntity_TieredTank.java | 13 +- 39 files changed, 232 insertions(+), 2643 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java index 8c7ca4c9e1..886500457b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java @@ -260,7 +260,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mCurrentSlot = (mCurrentSlot + 1) % 18; } switch (mMode) { - case 0: + case 0 -> { if (mInventory[mCurrentSlot] != null && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2 && mCurrentSlot < 8) { @@ -277,8 +277,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tRecipe[i].stackSize = 1; } } - break; - case 1: + } + case 1 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -308,10 +308,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 2: + } + case 2 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -329,10 +328,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 3: + } + case 3 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -353,10 +351,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 4: + } + case 4 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -382,10 +379,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 5: + } + case 5 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -397,11 +393,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); tTempStack.stackSize = 1; tRecipe[0] = tTempStack; - tOutput = GT_OreDictUnificator.get(true, tTempStack); - if (tOutput != null && GT_Utility.areStacksEqual(tOutput, tTempStack)) tOutput = null; - if (tOutput == null) { tRecipe[0] = null; if (mInventory[18] == null) { @@ -410,15 +403,14 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mTicksUntilNextUpdate = 1; } } - break; - case 6: + } + case 6 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } else if (OrePrefixes.dustSmall.contains(mInventory[mCurrentSlot])) { tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); tTempStack.stackSize = 1; @@ -433,7 +425,6 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } } else if (OrePrefixes.dustTiny.contains(mInventory[mCurrentSlot])) { tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); @@ -454,7 +445,6 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } } else { if (mInventory[18] == null && mThroughPut < 2) { @@ -462,10 +452,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 7: + } + case 7 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { @@ -492,10 +481,9 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mInventory[mCurrentSlot] = null; mTicksUntilNextUpdate = 1; } - break; } - break; - case 8: + } + case 8 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || mInventory[mCurrentSlot].getItemDamage() <= 0 || !mInventory[mCurrentSlot].getItem().isRepairable()) { @@ -525,8 +513,8 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B break; } } - break; - case 9: + } + case 9 -> { if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { if (mInventory[18] == null && mThroughPut < 2) { mInventory[18] = mInventory[mCurrentSlot]; @@ -547,7 +535,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } } if (tRecipe[1] == null) tRecipe[0] = null; - break; + } } } @@ -677,13 +665,13 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } private ArrayList recipeContent(ItemStack[] tRecipe) { - ArrayList tList = new ArrayList(); + ArrayList tList = new ArrayList<>(); for (byte i = 0; i < 9; i++) { if (tRecipe[i] != null) { boolean temp = false; - for (byte j = 0; j < tList.size(); j++) { - if (GT_Utility.areStacksEqual(tRecipe[i], tList.get(j))) { - tList.get(j).stackSize++; + for (ItemStack itemStack : tList) { + if (GT_Utility.areStacksEqual(tRecipe[i], itemStack)) { + itemStack.stackSize++; temp = true; break; } @@ -695,7 +683,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B } private ArrayList benchContent() { - ArrayList tList = new ArrayList(); + ArrayList tList = new ArrayList<>(); for (byte i = 0; i < 18; i++) { if (mInventory[i] != null) { boolean temp = false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java deleted file mode 100644 index 2c9a50dfa5..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java +++ /dev/null @@ -1,686 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.automation; - -import static net.minecraftforge.common.util.ForgeDirection.DOWN; -import static net.minecraftforge.common.util.ForgeDirection.EAST; -import static net.minecraftforge.common.util.ForgeDirection.NORTH; -import static net.minecraftforge.common.util.ForgeDirection.SOUTH; -import static net.minecraftforge.common.util.ForgeDirection.UP; -import static net.minecraftforge.common.util.ForgeDirection.WEST; - -import java.util.ArrayList; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.oredict.OreDictionary; - -import org.apache.commons.lang3.ArrayUtils; - -import com.gtnewhorizons.modularui.api.ModularUITextures; -import com.gtnewhorizons.modularui.api.drawable.IDrawable; -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; -import com.gtnewhorizons.modularui.common.widget.ButtonWidget; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Textures; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.modularui.IAddGregtechLogo; -import gregtech.api.interfaces.modularui.IAddUIWidgets; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntity_TieredMachineBlock - implements IAddGregtechLogo, IAddUIWidgets { - - public int[] mSlotRange = new int[4]; - public boolean mWorkedLastTick = false; - protected String mLocalName; - - public GT_MetaTileEntity_ElectricInventoryManager(final int aID, final int aTier, final String aDescription) { - super( - aID, - "basicmachine.automation.inventorymanager.0" + aTier, - "Electric Inventory Manager (" + GT_Values.VN[aTier] + ")", - aTier, - 16, - aDescription); - mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; - } - - public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String[] aDescription, - final ITexture[][][] aTextures) { - super(aName, aTier, 16, aDescription, aTextures); - } - - @Override - public boolean isTransformerUpgradable() { - return true; - } - - @Override - public boolean isOverclockerUpgradable() { - return false; - } - - @Override - public boolean isSimpleMachine() { - return false; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isEnetOutput() { - return true; - } - - @Override - public long maxEUInput() { - return GT_Values.V[mTier]; - } - - @Override - public long maxEUOutput() { - return GT_Values.V[mTier]; - } - - @Override - public long getMinimumStoredEU() { - return GT_Values.V[this.mTier]; - } - - @Override - public long maxEUStore() { - return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]); - } - - @Override - public long maxAmperesIn() { - return 4; - } - - @Override - public long maxAmperesOut() { - return 4; - } - - @Override - public boolean isValidSlot(int aIndex) { - return aIndex < 3; - } - - @Override - public boolean isInputFacing(ForgeDirection side) { - return !isOutputFacing(side); - } - - @Override - public boolean isOutputFacing(ForgeDirection side) { - for (int i = 0; i < mSlotRange.length; i++) { - if (side == getRangeDirection(i) && getRangeEnergy(i)) { - return true; - } - } - return false; - } - - @Override - public int getSizeInventory() { - return 16; - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - return true; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ElectricInventoryManager( - this.mName, - this.mTier, - this.mDescriptionArray, - this.mTextures); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setInteger("mSlotRange0", mSlotRange[0]); - aNBT.setInteger("mSlotRange1", mSlotRange[1]); - aNBT.setInteger("mSlotRange2", mSlotRange[2]); - aNBT.setInteger("mSlotRange3", mSlotRange[3]); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - mSlotRange[0] = aNBT.getInteger("mSlotRange0"); - mSlotRange[1] = aNBT.getInteger("mSlotRange1"); - mSlotRange[2] = aNBT.getInteger("mSlotRange2"); - mSlotRange[3] = aNBT.getInteger("mSlotRange3"); - } - - public void iterateRangeDirection(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7) | (((mSlotRange[aIndex] & 7) + 1) % 6); - } - - public void switchRangeEnergy(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8) | ((mSlotRange[aIndex] & 8) > 0 ? 0 : 8); - } - - public void iterateSlot1Direction(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~112) | (((((mSlotRange[aIndex] & 112) >> 4) + 1) % 6) << 4); - } - - public void iterateSlot2Direction(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~896) | (((((mSlotRange[aIndex] & 896) >> 7) + 1) % 6) << 7); - } - - public void iterateSlot3Direction(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7168) | (((((mSlotRange[aIndex] & 7168) >> 10) + 1) % 6) << 10); - } - - public void switchSlot1InOut(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8192) | ((mSlotRange[aIndex] & 8192) > 0 ? 0 : 8192); - } - - public void switchSlot2InOut(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~16384) | ((mSlotRange[aIndex] & 16384) > 0 ? 0 : 16384); - } - - public void switchSlot3InOut(int aIndex) { - mSlotRange[aIndex] = (mSlotRange[aIndex] & ~32768) | ((mSlotRange[aIndex] & 32768) > 0 ? 0 : 32768); - } - - public ForgeDirection getRangeDirection(int aIndex) { - return ForgeDirection.getOrientation(mSlotRange[aIndex] & 7); - } - - public ForgeDirection getSlot1Direction(int aIndex) { - return ForgeDirection.getOrientation((mSlotRange[aIndex] & 112) >> 4); - } - - public ForgeDirection getSlot2Direction(int aIndex) { - return ForgeDirection.getOrientation((mSlotRange[aIndex] & 896) >> 7); - } - - public ForgeDirection getSlot3Direction(int aIndex) { - return ForgeDirection.getOrientation((mSlotRange[aIndex] & 7168) >> 10); - } - - public boolean getRangeEnergy(int aIndex) { - return (mSlotRange[aIndex] & 8) > 0; - } - - public boolean getSlot1InOut(int aIndex) { - return (mSlotRange[aIndex] & 8192) > 0; - } - - public boolean getSlot2InOut(int aIndex) { - return (mSlotRange[aIndex] & 16384) > 0; - } - - public boolean getSlot3InOut(int aIndex) { - return (mSlotRange[aIndex] & 32768) > 0; - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() - && getBaseMetaTileEntity().getUniversalEnergyStored() >= 5000 - && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || getBaseMetaTileEntity().getTimer() % 100 == 0 - || mWorkedLastTick - || getBaseMetaTileEntity().hasInventoryBeenModified())) { - mWorkedLastTick = false; - - IInventory[] tTileEntities = new IInventory[] { getBaseMetaTileEntity().getIInventoryAtSide(DOWN), - getBaseMetaTileEntity().getIInventoryAtSide(UP), getBaseMetaTileEntity().getIInventoryAtSide(NORTH), - getBaseMetaTileEntity().getIInventoryAtSide(SOUTH), - getBaseMetaTileEntity().getIInventoryAtSide(WEST), - getBaseMetaTileEntity().getIInventoryAtSide(EAST), null, null }; - - int tCost = 0; - - for (int i = 0; i < 4; i++) { - final int ordinalRangeDirection = getRangeDirection(i).ordinal(); - if (tTileEntities[ordinalRangeDirection] != null) { - ArrayList tList = new ArrayList(); - ItemStack tStack; - tList.add(null); - - tStack = mInventory[3 + i * 3 + 0]; - if (tStack == null) { - if (getSlot1InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot1Direction(i), - getSlot1Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot1Direction(i), - getSlot1Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } else { - tList.set(0, tStack); - if (getSlot1InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot1Direction(i), - getSlot1Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot1Direction(i), - getSlot1Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - } - - tStack = mInventory[3 + i * 3 + 1]; - if (tStack == null) { - if (getSlot2InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot2Direction(i), - getSlot2Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot2Direction(i), - getSlot2Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } else { - tList.set(0, tStack); - if (getSlot2InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot2Direction(i), - getSlot2Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot2Direction(i), - getSlot2Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - } - - tStack = mInventory[3 + i * 3 + 2]; - if (tStack == null) { - if (getSlot3InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot3Direction(i), - getSlot3Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot3Direction(i), - getSlot3Direction(i), - null, - false, - (byte) 64, - (byte) 1, - (byte) 64, - (byte) 1); - } else { - tList.set(0, tStack); - if (getSlot3InOut(i)) tCost += 5 * GT_Utility.moveOneItemStack( - getBaseMetaTileEntity(), - tTileEntities[ordinalRangeDirection], - getSlot3Direction(i), - getSlot3Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - else tCost += 5 * GT_Utility.moveOneItemStack( - tTileEntities[ordinalRangeDirection], - getBaseMetaTileEntity(), - getSlot3Direction(i), - getSlot3Direction(i), - tList, - false, - (byte) tStack.stackSize, - (byte) 1, - (byte) 64, - (byte) 1); - } - } - } - - if (tCost > 0) { - mWorkedLastTick = true; - getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCost, true); - } - } - } - - @Override - public String[] getDescription() { - return ArrayUtils - .addAll(this.mDescriptionArray, "It's simpler than you think. I promise.", CORE.GT_Tooltip.get()); - } - - @Override - public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aStack) { - return false; - } - - @Override - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return true; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, - ItemStack aStack) { - return true; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[16][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getBottom(i); - rTextures[1][i + 1] = this.getTop(i); - rTextures[2][i + 1] = this.getNegativeZ(i); - rTextures[3][i + 1] = this.getPositiveZ(i); - rTextures[4][i + 1] = this.getNegativeX(i); - rTextures[5][i + 1] = this.getPositiveX(i); - rTextures[6][i + 1] = this.getBottomRedstone(i); - rTextures[7][i + 1] = this.getTopRedstone(i); - rTextures[8][i + 1] = this.getNegativeZRedstone(i); - rTextures[9][i + 1] = this.getPositiveZRedstone(i); - rTextures[10][i + 1] = this.getNegativeXRedstone(i); - rTextures[11][i + 1] = this.getPositiveXRedstone(i); - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[!aRedstone ? side.ordinal() : side.ordinal() + 6][aColorIndex < 0 ? 0 : aColorIndex]; - } - - public ITexture[] getBottom(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) }; - } - - public ITexture[] getTop(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green) }; - } - - public ITexture[] getNegativeZ(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue) }; - } - - public ITexture[] getPositiveZ(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan) }; - } - - public ITexture[] getNegativeX(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple) }; - } - - public ITexture[] getPositiveX(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow) }; - } - - public ITexture[] getBottomRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) }; - } - - public ITexture[] getTopRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone) }; - } - - public ITexture[] getNegativeZRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone) }; - } - - public ITexture[] getPositiveZRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone) }; - } - - public ITexture[] getNegativeXRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone) }; - } - - public ITexture[] getPositiveXRedstone(final byte aColor) { - return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], - new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone) }; - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addGregTechLogo(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17).setPos(154, 59)); - } - - // Internal copy of values stored in this tile. Client will use these to render stuff. - private final int[] mTargetDirections = new int[12]; - private final int[] mRangeDirections = new int[4]; - private final boolean[] mTargetInOut = new boolean[12]; - private final boolean[] mTargetEnergy = new boolean[4]; - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - for (int i = 0; i < 3; i++) { - builder.widget( - new SlotWidget(inventoryHandler, i) - .setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_CHEST) - .setPos(154, 4 + i * 18)); - } - - int[] slotXPositions = new int[] { 4, 60, 79, 135 }; - for (int i = 0; i < 12; i++) { - final int index = i; - builder.widget(new SlotWidget(new BaseSlot(inventoryHandler, i + 3, true)) { - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - super.phantomClick(clickData, cursorStack); - if (clickData.mouseButton != 0 && cursorStack != null && getMcSlot().getHasStack()) { - getMcSlot().getStack().setItemDamage(OreDictionary.WILDCARD_VALUE); - } - } - }.setControlsAmount(true).disableShiftInsert().setBackground(() -> { - if (index % 3 == 0) { - return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], - GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_COLOR[mRangeDirections[index / 3]] }; - } else if (index % 3 == 1) { - return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]], - GTPP_UITextures.OVERLAY_SLOT_INVENTORY_MANAGER_ARROW[mRangeDirections[index / 3]] }; - } else { - return new IDrawable[] { GTPP_UITextures.SLOT_INVENTORY_MANAGER[mRangeDirections[index / 3]] }; - } - }).setPos(slotXPositions[i / 3], 4 + (i % 3) * 18)); - } - for (int i = 0; i < 4; i++) { - final int index = i; - builder.widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchRangeEnergy(index)).setBackground( - () -> new IDrawable[] { - mTargetEnergy[index] ? ModularUITextures.ITEM_SLOT : GT_UITextures.BUTTON_STANDARD, - GT_UITextures.OVERLAY_BUTTON_EMIT_ENERGY }) - .setPos(slotXPositions[i], 59).setSize(18, 18)); - } - - int[] buttonXPositions = new int[] { 23, 41, 98, 116 }; - for (int i = 0; i < 12; i++) { - final int index = i; - builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (index % 3 == 0) { - if (clickData.mouseButton != 0) { - switchSlot1InOut(index / 3); - } else { - iterateSlot1Direction(index / 3); - } - } else if (index % 3 == 1) { - if (clickData.mouseButton != 0) { - switchSlot2InOut(index / 3); - } else { - iterateSlot2Direction(index / 3); - } - } else { - if (clickData.mouseButton != 0) { - switchSlot3InOut(index / 3); - } else { - iterateSlot3Direction(index / 3); - } - } - }).setBackground( - () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, - GTPP_UITextures.OVERLAY_BUTTON_DIRECTION[mTargetDirections[index]], - mTargetInOut[index] ? GTPP_UITextures.OVERLAY_BUTTON_TIP_RED - : GTPP_UITextures.OVERLAY_BUTTON_TIP_GREEN }) - .setPos(buttonXPositions[i / 3], 4 + (i % 3) * 18).setSize(18, 18)); - } - for (int i = 0; i < 4; i++) { - final int index = i; - builder.widget( - new ButtonWidget().setOnClick((clickData, widget) -> iterateRangeDirection(index)) - .setBackground( - () -> new IDrawable[] { GT_UITextures.BUTTON_STANDARD, - GTPP_UITextures.OVERLAY_BUTTON_DIRECTION_GRAY[mRangeDirections[index]] }) - .setPos(buttonXPositions[i], 59).setSize(18, 18)); - } - - for (int i = 0; i < mTargetDirections.length; i++) { - final int index = i; - builder.widget(new FakeSyncWidget.IntegerSyncer(() -> { - if (index % 3 == 0) { - return getSlot1Direction(index / 3).ordinal(); - } else if (index % 3 == 1) { - return getSlot2Direction(index / 3).ordinal(); - } else { - return getSlot3Direction(index / 3).ordinal(); - } - }, val -> mTargetDirections[index] = val)); - } - for (int i = 0; i < mRangeDirections.length; i++) { - final int index = i; - builder.widget( - new FakeSyncWidget.IntegerSyncer( - () -> getRangeDirection(index).ordinal(), - val -> mRangeDirections[index] = val)); - } - for (int i = 0; i < mTargetInOut.length; i++) { - final int index = i; - builder.widget(new FakeSyncWidget.BooleanSyncer(() -> { - if (index % 3 == 0) { - return getSlot1InOut(index / 3); - } else if (index % 3 == 1) { - return getSlot2InOut(index / 3); - } else { - return getSlot3InOut(index / 3); - } - }, val -> mTargetInOut[index] = val)); - } - for (int i = 0; i < mTargetEnergy.length; i++) { - final int index = i; - builder.widget( - new FakeSyncWidget.BooleanSyncer(() -> getRangeEnergy(index), val -> mTargetEnergy[index] = val)); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index 2427cb12ae..25609343d3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -245,29 +245,30 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi if (side == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { - case 0: + case 0 -> { try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 64; - break; - case 1: + } + case 1 -> { try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 64; - break; - case 2: + } + case 2 -> { try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 512; - break; - case 3: + } + case 3 -> { try { CORE.sTesseractGeneratorOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 512; + } } if (getGeneratorEntity(this.mFrequency) != null && getGeneratorEntity(this.mFrequency) != this) { GT_Utility.sendChatToPlayer( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index 18314c059f..5b305950ff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -198,29 +198,30 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic if (side == this.getBaseMetaTileEntity().getFrontFacing()) { final float[] tCoords = GT_Utility.getClickedFacingCoords(side, aX, aY, aZ); switch ((byte) ((byte) (int) (tCoords[0] * 2.0F) + (2 * (byte) (int) (tCoords[1] * 2.0F)))) { - case 0: + case 0 -> { try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 64; - break; - case 1: + } + case 1 -> { try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 64; - break; - case 2: + } + case 2 -> { try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency -= 512; - break; - case 3: + } + case 3 -> { try { CORE.sTesseractTerminalOwnershipMap.get(mOwner).remove(this.mFrequency); } catch (Throwable t) {} this.mFrequency += 512; + } } GT_Utility.sendChatToPlayer( aPlayer, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index ee85b16f5f..95c5a7eeaf 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -88,8 +88,6 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { } else { return new GT_RenderedTexture(Textures.BlockIcons.MACHINE_HV_SIDE); } - // return new - // GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 3b54fb46a7..cca69bc5d5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -128,7 +128,9 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator if (this.mInventory[getStackDisplaySlot()] == null) this.mInventory[getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1); this.mInventory[getStackDisplaySlot()].setStackDisplayName( - "Generating: " + (aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + "Generating: " + + GT_Utility.formatNumbers( + aBaseMetaTileEntity.getUniversalEnergyStored() - getMinimumStoredEU()) + " EU"); } } else { @@ -177,8 +179,8 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mDescriptionArray, "Fuel is measured in minecraft days (Check with Scanner)", "RTG changes output voltage depending on fuel", - "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", + "Generates power at " + GT_Utility.formatNumbers(this.getEfficiency()) + "% Efficiency per tick", + "Output Voltage: " + GT_Utility.formatNumbers(this.getOutputTier()) + " EU/t", CORE.GT_Tooltip.get()); } @@ -310,7 +312,6 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mCurrentRecipe = tFuel; int voltage = tFuel.mEUt; this.mVoltage = voltage; - int sfsf = this.mTier; // this.mDaysRemaining = tFuel.mSpecialValue*365; // Do some voodoo. @@ -326,8 +327,6 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } else if (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_SR90.get(1))) { mTier2 = 1; } else { - // Utils.LOG_INFO("test:"+tFuel.mInputs[0].getDisplayName() + " | " + - // (ItemStack.areItemStacksEqual(tFuel.mInputs[0], GregtechItemList.Pellet_RTG_PU238.get(1)))); mTier2 = 0; } ReflectionUtils.setByte(this, "mTier", mTier2); @@ -345,8 +344,6 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator this.mDaysRemaining = MathUtils.roundToClosestInt(mTicksToBurnFor / 20 / 60 / 3); Logger.WARNING("step | " + (int) (mTicksToBurnFor * getEfficiency() / 100L)); return (int) (mTicksToBurnFor * getEfficiency() / 100L); - // return (int) (tFuel.mSpecialValue * 365L * getEfficiency() / 100L); - // return tFuel.mEUt; } Logger.WARNING("Not sure"); return 0; @@ -373,12 +370,11 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public String[] getInfoData() { return new String[] { "RTG - Running at tier " + this.mTier, - "Active: " + this.getBaseMetaTileEntity().isActive(), "Current Output: " + this.mVoltage + " EU/t", - "Days of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 20), - "Hours of Fuel remaining: " + (mTicksToBurnFor / 20 / 60 / 60), - "Ticks of " + this.mVoltage + "v remaining: " + (mTicksToBurnFor), - "Current Recipe input: " + this.mCurrentRecipe != null - ? this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" - : "NUll" }; + "Active: " + this.getBaseMetaTileEntity().isActive(), + "Current Output: " + GT_Utility.formatNumbers(mVoltage) + " EU/t", + "Days of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 20), + "Hours of Fuel remaining: " + GT_Utility.formatNumbers(mTicksToBurnFor / 20 / 60 / 60), + "Ticks of " + this.mVoltage + "v remaining: " + mTicksToBurnFor, + this.mCurrentRecipe.mInputs[0].getDisplayName() + " x1" }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java deleted file mode 100644 index e0d13325e9..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java +++ /dev/null @@ -1,65 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; - -import static gregtech.api.enums.GT_Values.V; - -import org.apache.commons.lang3.ArrayUtils; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.common.tileentities.generators.GT_MetaTileEntity_GasTurbine; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; - -public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbine { - - private static final int EFFICIENCY_DEFAULT = 95; - - public GT_MetaTileEntity_ULV_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, EFFICIENCY_DEFAULT); - } - - public GT_MetaTileEntity_ULV_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures, EFFICIENCY_DEFAULT); - } - - @Override - public String[] getDescription() { - return ArrayUtils.addAll( - this.mDescriptionArray, - "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", - CORE.GT_Tooltip.get()); - } - - @Override - public long maxEUStore() { - return Math.max(getEUVar(), V[1] * 80L + getMinimumStoredEU()); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - @Override - public int getCapacity() { - return 16000; - } - - @Override - public void onConfigLoad() { - this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, EFFICIENCY_DEFAULT); - } - - @Override - public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { super.getSidesActive(aColor)[0], - new GT_RenderedTexture((IIconContainer) TexturesGtBlock.Overlay_Machine_Turbine_Active) }; - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java index 1d8d3a42d3..972fc086f9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -151,32 +151,22 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank return 21; } - private static final int getRange(int aTier) { - switch (aTier) { - case 1: - return 1; - case 2: - return 5; - case 3: - return 9; - case 4: - return 13; - case 5: - return 17; - case 6: - return 21; - case 7: - return 25; - case 8: - return 29; - case 9: - return 33; - default: - return 0; - } - } - - private HashSet mCropCache = new HashSet(); + private static int getRange(int aTier) { + return switch (aTier) { + case 1 -> 1; + case 2 -> 5; + case 3 -> 9; + case 4 -> 13; + case 5 -> 17; + case 6 -> 21; + case 7 -> 25; + case 8 -> 29; + case 9 -> 33; + default -> 0; + }; + } + + private HashSet mCropCache = new HashSet<>(); private boolean mInvalidCache = false; public boolean doesInventoryHaveSpace() { @@ -222,8 +212,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank for (int x = (-aSide); x <= aSide; x++) { for (int z = (-aSide); z <= aSide; z++) { TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z); - if (tTileEntity != null && tTileEntity instanceof ICropTile) { - ICropTile tCrop = (ICropTile) tTileEntity; + if (tTileEntity != null && tTileEntity instanceof ICropTile tCrop) { this.mCropCache.add(tCrop); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 469f5f4d6b..03b0fe9b13 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -3,7 +3,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GT_Values.V; import java.util.Collections; -import java.util.HashMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -39,9 +38,7 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine; import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -58,14 +55,6 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi protected boolean mSaveRotor = false; - private static final HashMap mConveyorMap = new HashMap<>(); - - static { - for (byte i = 0; i < 9; i++) { - mConveyorMap.put(i, CI.getConveyor(i, 1)); - } - } - public GregtechMetaAtmosphericReconditioner(int aID, String aName, String aNameRegional, int aTier) { super( aID, @@ -93,12 +82,6 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } - /* - * public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, ITexture[][][] - * aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, - * aNEIName); } - */ - @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GregtechMetaAtmosphericReconditioner(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); @@ -374,7 +357,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi if (this.mTier < 7) { mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity()); } else { - AutoMap aSurrounding = new AutoMap(); + AutoMap aSurrounding = new AutoMap<>(); World aWorld = this.getBaseMetaTileEntity().getWorld(); int xPos = this.getBaseMetaTileEntity().getXCoord(); int zPos = this.getBaseMetaTileE