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 --- .../common/blocks/GregtechMetaCasingBlocks3.java | 2 +- .../common/blocks/GregtechMetaCasingBlocks5.java | 48 +- .../GregtechMetaCasingBlocksPipeGearbox.java | 22 +- .../blocks/GregtechMetaSpecialMachineCasings.java | 18 +- .../blocks/GregtechMetaSpecialMultiCasings.java | 54 +- .../blocks/GregtechMetaSpecialMultiCasings2.java | 30 +- .../blocks/GregtechMetaTieredCasingBlocks1.java | 26 +- .../blocks/textures/CasingTextureHandler.java | 56 +- .../blocks/textures/CasingTextureHandler2.java | 51 +- .../blocks/textures/CasingTextureHandler3.java | 68 +- .../blocks/textures/CasingTextureHandler6.java | 17 +- .../textures/TexturesCentrifugeMultiblock.java | 15 +- .../blocks/textures/TexturesGrinderMultiblock.java | 15 +- .../common/blocks/textures/TexturesGtBlock.java | 4 +- .../common/blocks/textures/TexturesGtTools.java | 4 +- .../common/covers/GTPP_Cover_Overflow.java | 6 +- .../common/covers/GTPP_Cover_ToggleVisual.java | 6 +- .../gregtech/common/helpers/ChargingHelper.java | 3 +- .../common/helpers/FlotationRecipeHandler.java | 4 +- .../gregtech/common/helpers/TreeFarmHelper.java | 13 +- .../common/helpers/tesseract/TesseractHelper.java | 34 +- .../gregtech/common/items/MetaCustomCoverItem.java | 2 +- .../common/items/MetaGeneratedGregtechItems.java | 391 +++--------- .../common/items/MetaGeneratedGregtechTools.java | 44 +- .../items/behaviours/Behaviour_Choocher.java | 3 +- .../behaviours/Behaviour_Electric_Lighter.java | 11 +- .../gregtech/common/render/GTPP_CapeRenderer.java | 69 +- .../common/render/GTPP_Render_MachineBlock.java | 36 +- .../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 +- .../tools/TOOL_Gregtech_ElectricButcherKnife.java | 187 ------ .../tools/TOOL_Gregtech_ElectricLighter.java | 165 ----- 69 files changed, 599 insertions(+), 3680 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 delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java index c38b7d4282..5a16d0a20d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks3.java @@ -65,7 +65,7 @@ public class GregtechMetaCasingBlocks3 extends GregtechMetaCasingBlocksAbstract GT_LanguageManager .addStringLocalization(this.getUnlocalizedName() + ".7.name", "Vanadium Redox Power Cell (UV)"); GT_LanguageManager - .addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (MAX)"); + .addStringLocalization(this.getUnlocalizedName() + ".8.name", "Vanadium Redox Power Cell (UHV)"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Supply Depot Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Advanced Cryogenic Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Volcanus Casing"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 99228b6ed3..26c747e50e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -81,53 +81,69 @@ public class GregtechMetaCasingBlocks5 extends GregtechMetaCasingBlocksAbstract public static IIcon getStaticIcon(final int ordinalSide, final int aMeta) { if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - case 0: + case 0 -> { return TexturesGtBlock.TEXTURE_PIPE_GRINDING_MILL.getIcon(); - case 1: + } + case 1 -> { return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon(); - case 2: + } + case 2 -> { return TexturesGtBlock.TEXTURE_GEARBOX_GRINDING_MILL.getIcon(); - case 3: + } + case 3 -> { return TexturesGtBlock.TEXTURE_TECH_PANEL_D.getIcon(); - case 4: + } + case 4 -> { return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); - case 5: + } + case 5 -> { return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon(); - case 6: + } + case 6 -> { return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon(); - case 7: + } + case 7 -> { if (ordinalSide == 0 || ordinalSide == 1) { return TexturesGtBlock.Manipulator_Top.getIcon(); } return TexturesGtBlock.NeutronPulseManipulator.getIcon(); - case 8: + } + case 8 -> { if (ordinalSide == 0 || ordinalSide == 1) { return TexturesGtBlock.Manipulator_Top.getIcon(); } return TexturesGtBlock.CosmicFabricManipulator.getIcon(); - case 9: + } + case 9 -> { if (ordinalSide == 0 || ordinalSide == 1) { return TexturesGtBlock.Manipulator_Top.getIcon(); } return TexturesGtBlock.InfinityInfusedManipulator.getIcon(); - case 10: + } + case 10 -> { if (ordinalSide == 0 || ordinalSide == 1) { return TexturesGtBlock.Manipulator_Top.getIcon(); } return TexturesGtBlock.SpaceTimeContinuumRipper.getIcon(); - case 11: + } + case 11 -> { return TexturesGtBlock.NeutronShieldingCore.getIcon(); - case 12: + } + case 12 -> { return TexturesGtBlock.CosmicFabricShieldingCore.getIcon(); - case 13: + } + case 13 -> { return TexturesGtBlock.InfinityInfusedShieldingCore.getIcon(); - case 14: + } + case 14 -> { return TexturesGtBlock.SpaceTimeBendingCore.getIcon(); - case 15: + } + case 15 -> { if (ordinalSide == 0 || ordinalSide == 1) { return TexturesGtBlock.Blank.getIcon(); } return TexturesGtBlock.ForceFieldGlass.getIcon(); + } } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java index f6c53e875e..17b5507416 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksPipeGearbox.java @@ -15,7 +15,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlocksAbstract { - private static HashMap sMaterialMapping = new HashMap(); + private static HashMap sMaterialMapping = new HashMap<>(); public GregtechMetaCasingBlocksPipeGearbox() { super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.pipesgears", GT_Material_Casings.INSTANCE); @@ -60,24 +60,12 @@ public class GregtechMetaCasingBlocksPipeGearbox extends GregtechMetaCasingBlock public IIcon getIcon(final int ordinalSide, final int meta) { if ((meta >= 0) && (meta < 16)) { switch (meta) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: + case 0, 1, 2, 3, 4, 5, 6, 7 -> { return TexturesGtBlock.TEXTURE_GEARBOX_GENERIC.getIcon(); - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: + } + case 8, 9, 10, 11, 12, 13, 14, 15 -> { return TexturesGtBlock.TEXTURE_PIPE_GENERIC.getIcon(); + } } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java index b16868aeb2..a8ea05ddbc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMachineCasings.java @@ -65,16 +65,12 @@ public class GregtechMetaSpecialMachineCasings extends GregtechMetaCasingBlocksA @Override public IIcon getIcon(int ordinalSide, int aMeta) { - switch (aMeta) { - case 0: - return Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); - case 2: - return TexturesGtBlock.Casing_Material_Laurenium.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + return switch (aMeta) { + case 0 -> Textures.BlockIcons.MACHINE_BRONZEPLATEDBRICKS.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_FROST_PROOF.getIcon(); + case 2 -> TexturesGtBlock.Casing_Material_Laurenium.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_HEATPROOFCASING.getIcon(); + default -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index 61e74fc56a..411fef65d3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -97,40 +97,24 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs } public static IIcon getStaticIcon(final int ordinalSide, final byte aMeta) { - switch (aMeta) { - case 0: - return TexturesGtBlock.Casing_Redox_1.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); - case 2: - return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); - case 4: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); - case 5: - return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); - case 6: - return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); - case 7: - return TexturesGtBlock.Casing_Material_Stellite.getIcon(); - case 8: - return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); - case 9: - return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); - case 10: - return TexturesGtBlock.Casing_Material_Talonite.getIcon(); - case 11: - return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); - case 12: - return TexturesGtBlock.Casing_Redox_5.getIcon(); - case 13: - return TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon(); - case 14: - return TexturesGtBlock.Casing_Material_Talonite.getIcon(); - case 15: - return TexturesGtBlock.Turbine_SC_Material_Casing.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + return switch (aMeta) { + case 0 -> TexturesGtBlock.Casing_Redox_1.getIcon(); + case 1 -> Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 5 -> TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 6 -> TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 7 -> TexturesGtBlock.Casing_Material_Stellite.getIcon(); + case 8 -> TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 9 -> TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); + case 10 -> TexturesGtBlock.Casing_Material_Talonite.getIcon(); + case 11 -> Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + case 12 -> TexturesGtBlock.Casing_Redox_5.getIcon(); + case 13 -> TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon(); + case 14 -> TexturesGtBlock.Casing_Material_Talonite.getIcon(); + case 15 -> TexturesGtBlock.Turbine_SC_Material_Casing.getIcon(); + default -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java index 1cc2403973..d9ae7fc1c6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -84,24 +84,16 @@ public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAb } public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { - switch (aMeta) { - case 0: - return TexturesGtBlock.Casing_Resonance_1.getIcon(); - case 1: - return TexturesGtBlock.Casing_Resonance_2.getIcon(); - case 2: - return TexturesGtBlock.Casing_Resonance_3.getIcon(); - case 3: - return TexturesGtBlock.Casing_Resonance_4.getIcon(); - case 4: - return TexturesGtBlock.Casing_Modulator_1.getIcon(); - case 5: - return TexturesGtBlock.Casing_Modulator_2.getIcon(); - case 6: - return TexturesGtBlock.Casing_Modulator_3.getIcon(); - case 7: - return TexturesGtBlock.Casing_Modulator_4.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + return switch (aMeta) { + case 0 -> TexturesGtBlock.Casing_Resonance_1.getIcon(); + case 1 -> TexturesGtBlock.Casing_Resonance_2.getIcon(); + case 2 -> TexturesGtBlock.Casing_Resonance_3.getIcon(); + case 3 -> TexturesGtBlock.Casing_Resonance_4.getIcon(); + case 4 -> TexturesGtBlock.Casing_Modulator_1.getIcon(); + case 5 -> TexturesGtBlock.Casing_Modulator_2.getIcon(); + case 6 -> TexturesGtBlock.Casing_Modulator_3.getIcon(); + case 7 -> TexturesGtBlock.Casing_Modulator_4.getIcon(); + default -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java index c9f748e171..7ddab1c471 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaTieredCasingBlocks1.java @@ -63,7 +63,7 @@ public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbs GregtechItemList.GTPP_Casing_LuV.set(new ItemStack(this, 1, 6)); GregtechItemList.GTPP_Casing_ZPM.set(new ItemStack(this, 1, 7)); GregtechItemList.GTPP_Casing_UV.set(new ItemStack(this, 1, 8)); - GregtechItemList.GTPP_Casing_MAX.set(new ItemStack(this, 1, 9)); + GregtechItemList.GTPP_Casing_UHV.set(new ItemStack(this, 1, 9)); } @Override @@ -71,20 +71,14 @@ public class GregtechMetaTieredCasingBlocks1 extends GregtechMetaCasingBlocksAbs if (aMeta < 10) { return TexturesGtBlock.TIERED_MACHINE_HULLS[aMeta].getIcon(); } - switch (aMeta) { - case 10: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 11: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 12: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 13: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 14: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 15: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + return switch (aMeta) { + case 10 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 11 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 12 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 13 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 14 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + case 15 -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + default -> Textures.BlockIcons.RENDERING_ERROR.getIcon(); + }; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java index ec1ee2a226..3409277f91 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java @@ -13,57 +13,39 @@ public class CasingTextureHandler { public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { - switch (aMeta) { + return switch (aMeta) { // Centrifuge - case 0: - return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); + case 0 -> TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); // Coke Oven Frame - case 1: - return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); + case 1 -> TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); // Coke Oven Casing Tier 1 - case 2: - return Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); + case 2 -> Textures.BlockIcons.MACHINE_CASING_FIREBOX_BRONZE.getIcon(); // Coke Oven Casing Tier 2 - case 3: - return Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); + case 3 -> Textures.BlockIcons.MACHINE_CASING_FIREBOX_STEEL.getIcon(); // Material Press Casings - case 4: - return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 4 -> Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); // Electrolyzer Casings - case 5: - return TexturesGtBlock.Casing_Material_Potin.getIcon(); + case 5 -> TexturesGtBlock.Casing_Material_Potin.getIcon(); // Broken Blue Fusion Casings - case 6: - return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 6 -> TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); // Maceration Stack Casings - case 7: - return TexturesGtBlock.Casing_Material_Tumbaga.getIcon(); + case 7 -> TexturesGtBlock.Casing_Material_Tumbaga.getIcon(); // Broken Pink Fusion Casings - case 8: - return TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); + case 8 -> TexturesGtBlock.TEXTURE_ORGANIC_PANEL_A_GLOWING.getIcon(); // Matter Fabricator Casings - case 9: - return TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon(); + case 9 -> TexturesGtBlock.TEXTURE_METAL_PANEL_F.getIcon(); // Iron Blast Fuance Textures - case 10: - return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 10 -> TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); // Multitank Exterior Casing - case 11: - return TexturesGtBlock.Casing_Material_Grisium.getIcon(); + case 11 -> TexturesGtBlock.Casing_Material_Grisium.getIcon(); // Reactor Casing I - case 12: - return TexturesGtBlock.Casing_Material_Stellite.getIcon(); + case 12 -> TexturesGtBlock.Casing_Material_Stellite.getIcon(); // Reactor Casing II - case 13: - return TexturesGtBlock.Casing_Material_Zeron100.getIcon(); - case 14: - return TexturesGtBlock.Casing_Staballoy_Firebox.getIcon(); - case 15: - return TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon(); - - default: - return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); - } + case 13 -> TexturesGtBlock.Casing_Material_Zeron100.getIcon(); + case 14 -> TexturesGtBlock.Casing_Staballoy_Firebox.getIcon(); + case 15 -> TexturesGtBlock.Casing_Material_ZirconiumCarbide.getIcon(); + default -> Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon(); + }; } return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java index e02a9ffbd3..1da572fb35 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler2.java @@ -9,44 +9,61 @@ public class CasingTextureHandler2 { public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { switch (aMeta) { - case 0: + case 0 -> { return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); - case 1: + } + case 1 -> { return TexturesGtBlock.Casing_Material_HastelloyX.getIcon(); - case 2: + } + case 2 -> { return TexturesGtBlock.Casing_Material_HastelloyN.getIcon(); - case 3: + } + case 3 -> { return TexturesGtBlock.Casing_Material_Fluid_IncoloyDS.getIcon(); - case 4: + } + case 4 -> { return TexturesGtBlock.Casing_Material_Grisium.getIcon(); - case 5: + } + case 5 -> { return TexturesGtBlock.Casing_Machine_Metal_Panel_A.getIcon(); - case 6: + } + case 6 -> { return TexturesGtBlock.Casing_Machine_Metal_Grate_A.getIcon(); - case 7: + } + case 7 -> { return TexturesGtBlock.Casing_Redox_1.getIcon(); - case 8: + } + case 8 -> { return TexturesGtBlock.Casing_Machine_Metal_Sheet_A.getIcon(); - case 9: + } + case 9 -> { return TexturesGtBlock.Overlay_Machine_Cyber_A.getIcon(); - case 10: + } + case 10 -> { return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); - case 11: + } + case 11 -> { return TexturesGtBlock.Casing_Material_Tantalloy61.getIcon(); - case 12: + } + case 12 -> { return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); - case 13: + } + case 13 -> { if (ordinalSide < 2) { return TexturesGtBlock.TEXTURE_TECH_A.getIcon(); } else { return TexturesGtBlock.TEXTURE_TECH_B.getIcon(); } - case 14: + } + case 14 -> { return Textures.BlockIcons.RENDERING_ERROR.getIcon(); - case 15: + } + case 15 -> { return TexturesGtBlock.Casing_Machine_Acacia_Log.getIcon(); - default: + } + default -> { return TexturesGtBlock.Overlay_UU_Matter.getIcon(); + } } } return TexturesGtBlock._PlaceHolder.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java index 9ffbbd6a85..6b2627ec39 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler3.java @@ -8,55 +8,49 @@ public class CasingTextureHandler3 { public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { - switch (aMeta) { - case 0: + return switch (aMeta) { + case 0 -> // Aquatic Casing - return TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon(); - case 1: + TexturesGtBlock.TEXTURE_METAL_PANEL_B.getIcon(); + case 1 -> // Inconel Reinforced Casing - return TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon(); - case 2: + TexturesGtBlock.TEXTURE_METAL_PANEL_D.getIcon(); + case 2 -> // Multi-Use Casing - return TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon(); - case 3: + TexturesGtBlock.TEXTURE_METAL_PANEL_C.getIcon(); + case 3 -> // Trinium Plated Mining Platform Casing - return TexturesGtBlock.Casing_Trinium_Naquadah_Vent.getIcon(); - case 4: + TexturesGtBlock.Casing_Trinium_Naquadah_Vent.getIcon(); + case 4 -> // Vanadium Redox IV - return TexturesGtBlock.Casing_Redox_2.getIcon(); - case 5: + TexturesGtBlock.Casing_Redox_2.getIcon(); + case 5 -> // Vanadium Redox LuV - return TexturesGtBlock.Casing_Redox_3.getIcon(); - case 6: + TexturesGtBlock.Casing_Redox_3.getIcon(); + case 6 -> // Vanadium Redox ZPM - return TexturesGtBlock.Casing_Redox_4.getIcon(); - case 7: + TexturesGtBlock.Casing_Redox_4.getIcon(); + case 7 -> // Vanadium Redox UV - return TexturesGtBlock.Casing_Redox_5.getIcon(); - case 8: + TexturesGtBlock.Casing_Redox_5.getIcon(); + case 8 -> // Vanadium Redox MAX - return TexturesGtBlock.Casing_Redox_6.getIcon(); - case 9: + TexturesGtBlock.Casing_Redox_6.getIcon(); + case 9 -> // Amazon Warehouse Casing - return TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon(); - case 10: + TexturesGtBlock.TEXTURE_CASING_AMAZON.getIcon(); + case 10 -> // Adv. Vac. Freezer - return TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon(); - case 11: + TexturesGtBlock.TEXTURE_CASING_ADVANCED_CRYOGENIC.getIcon(); + case 11 -> // Adv. EBF - return TexturesGtBlock.TEXTURE_CASING_ADVANCED_VOLCNUS.getIcon(); - case 12: - return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II.getIcon(); - case 13: - return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II_INNER.getIcon(); - case 14: - return TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA.getIcon(); - case 15: - return TexturesGtBlock.TEXTURE_MAGIC_PANEL_A.getIcon(); - - default: - return TexturesGtBlock._PlaceHolder.getIcon(); - } + TexturesGtBlock.TEXTURE_CASING_ADVANCED_VOLCNUS.getIcon(); + case 12 -> TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II.getIcon(); + case 13 -> TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_II_INNER.getIcon(); + case 14 -> TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_ULTRA.getIcon(); + case 15 -> TexturesGtBlock.TEXTURE_MAGIC_PANEL_A.getIcon(); + default -> TexturesGtBlock._PlaceHolder.getIcon(); + }; } return TexturesGtBlock._PlaceHolder.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler6.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler6.java index e33099b09a..b8d5a024df 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler6.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler6.java @@ -8,17 +8,12 @@ public class CasingTextureHandler6 { public static IIcon getIcon(final int ordinalSide, final int aMeta) { // Texture ID's. case 0 == ID[57] if ((aMeta >= 0) && (aMeta < 16)) { - switch (aMeta) { - case 0: - return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_III.getIcon(); - case 1: - return TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_III_INNER.getIcon(); - case 2: - return TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER.getIcon(); - default: - return TexturesGtBlock._PlaceHolder.getIcon(); - - } + return switch (aMeta) { + case 0 -> TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_III.getIcon(); + case 1 -> TexturesGtBlock.TEXTURE_CASING_FUSION_COIL_III_INNER.getIcon(); + case 2 -> TexturesGtBlock.TEXTURE_CASING_FUSION_CASING_HYPER.getIcon(); + default -> TexturesGtBlock._PlaceHolder.getIcon(); + }; } return TexturesGtBlock._PlaceHolder.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java index 8ad5bd914d..f4d0ec0608 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesCentrifugeMultiblock.java @@ -66,8 +66,7 @@ public class TexturesCentrifugeMultiblock { private static int isCentrifugeControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection side) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; - IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; + if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IndustrialCentrifuge && tTile.getFrontFacing() == side) return tTile.isActive() ? 1 : 2; @@ -84,7 +83,7 @@ public class TexturesCentrifugeMultiblock { int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; switch (ordinalSide / 2) { - case 0: + case 0 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -95,8 +94,8 @@ public class TexturesCentrifugeMultiblock { } } } - break; - case 1: + } + case 1 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -107,8 +106,8 @@ public class TexturesCentrifugeMultiblock { } } } - break; - case 2: + } + case 2 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -119,7 +118,7 @@ public class TexturesCentrifugeMultiblock { } } } - break; + } } return TexturesGtBlock.Casing_Material_Centrifuge.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java index f042b88370..fab36fbcea 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGrinderMultiblock.java @@ -60,8 +60,7 @@ public class TexturesGrinderMultiblock { private static int isIsaControllerWithSide(IBlockAccess aWorld, int aX, int aY, int aZ, ForgeDirection side) { TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (!(tTileEntity instanceof IGregTechTileEntity)) return 0; - IGregTechTileEntity tTile = (IGregTechTileEntity) tTileEntity; + if (!(tTileEntity instanceof IGregTechTileEntity tTile)) return 0; if (tTile.getMetaTileEntity() instanceof GregtechMetaTileEntity_IsaMill && tTile.getFrontFacing() == side) return tTile.isActive() ? 1 : 2; return 0; @@ -76,7 +75,7 @@ public class TexturesGrinderMultiblock { } int tInvertLeftRightMod = ordinalSide % 2 * 2 - 1; switch (ordinalSide / 2) { - case 0: + case 0 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -87,8 +86,8 @@ public class TexturesGrinderMultiblock { } } } - break; - case 1: + } + case 1 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -99,8 +98,8 @@ public class TexturesGrinderMultiblock { } } } - break; - case 2: + } + case 2 -> { for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i == 0 && j == 0) continue; @@ -111,7 +110,7 @@ public class TexturesGrinderMultiblock { } } } - break; + } } return TexturesGtBlock.TEXTURE_CASING_GRINDING_MILL.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index cac8aa742f..3d71f00514 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -19,7 +19,7 @@ public class TexturesGtBlock { private static boolean mAnimated = CORE.ConfigSwitches.enableAnimatedTextures; - private static AutoMap mCustomiconMap = new AutoMap(); + private static AutoMap mCustomiconMap = new AutoMap<>(); static {} @@ -276,8 +276,6 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Redox_4 = new CustomIcon("redox/redox4"); public static final CustomIcon Casing_Redox_5 = new CustomIcon("redox/redox5"); public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6"); - // public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7"); - // public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8"); // Special Block 2 public static final CustomIcon Casing_Resonance_1 = new CustomIcon("special/block_1"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java index dfb519a445..7400bb987c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtTools.java @@ -19,8 +19,8 @@ public final class TexturesGtTools { public static final class CustomIcon implements IIconContainer, Runnable { - protected IIcon mIcon, mOverlay; - protected final String mIconName; + private IIcon mIcon, mOverlay; + private final String mIconName; public CustomIcon(final String aIconName) { this.mIconName = aIconName; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java index af80b7c684..d3b8dc3498 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_Overflow.java @@ -46,8 +46,6 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { directionFrom = ForgeDirection.UNKNOWN; tTank1 = (IFluidHandler) aTileEntity; if (tTank1 != null) { - // Logger.INFO("Found Self. "+aSide); - // FluidStack aTankStack = tTank1.drain(ForgeDirection.UNKNOWN, 1, false); FluidStack aTankStack = tTank1.getTankInfo(directionFrom)[0].fluid; if (aTankStack != null) { // Logger.INFO("Found Fluid inside self - "+aTankStack.getLocalizedName()+", overflow point set at @@ -217,8 +215,8 @@ public class GTPP_Cover_Overflow extends GT_CoverBehavior { (warn.get() ? GT_Utility.trans("325", "Max") : GT_Utility.trans("324", "Now")) + ": " + convert(getCoverData()) - + "/" - + mMaxTransferRate + + " / " + + GT_Utility.formatNumbers(mMaxTransferRate) + " " + GT_Utility.trans("323", "L")).color( warn.get() ? COLOR_TEXT_WARN.get() diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java index 44ddf9f6cf..cea96cefea 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/covers/GTPP_Cover_ToggleVisual.java @@ -21,8 +21,8 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { - private static final Map sConnectionStateForEntityMap = new ConcurrentHashMap(); - private static final Map sPrefixMap = new ConcurrentHashMap(); + private static final Map sConnectionStateForEntityMap = new ConcurrentHashMap<>(); + private static final Map sPrefixMap = new ConcurrentHashMap<>(); private static final int VALUE_OFF = 0; private static final int VALUE_ON = 1; @@ -153,7 +153,7 @@ public class GTPP_Cover_ToggleVisual extends GT_CoverBehavior { return aCoverVar == VALUE_ON; } - private static final void trySetState(ForgeDirection side, int aState, ICoverable aTile) { + private static void trySetState(ForgeDirection side, int aState, ICoverable aTile) { // Try set cover state directly if (aTile instanceof IGregTechTileEntity gTileEntity) { gTileEntity.setCoverDataAtSide(side, new ISerializableObject.LegacyCoverData(aState)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index ce9ea45841..a2114ab375 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -1,7 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.helpers; import static gregtech.api.GregTech_API.mEUtoRF; -import static gregtech.api.enums.Mods.*; +import static gregtech.api.enums.Mods.Baubles; +import static gregtech.api.enums.Mods.COFHCore; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java index b866be1d87..8cbb473a42 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/FlotationRecipeHandler.java @@ -13,8 +13,8 @@ import gtPlusPlus.core.material.Material; public class FlotationRecipeHandler { - private static final HashMap sMaterialMap = new HashMap(); - private static final HashMap sMilledMap = new HashMap(); + private static final HashMap sMaterialMap = new HashMap<>(); + private static final HashMap sMilledMap = new HashMap<>(); public static boolean registerOreType(Material aMaterial) { String aMaterialKey = aMaterial.getUnlocalizedName(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java index a8b3ea15ea..7774a34dc1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/TreeFarmHelper.java @@ -13,16 +13,15 @@ public class TreeFarmHelper { public static SAWTOOL isCorrectMachinePart(final ItemStack aStack) { if (aStack != null && aStack.getItem() instanceof GT_MetaGenerated_Tool_01) { switch (aStack.getItemDamage()) { - case GT_MetaGenerated_Tool_01.SAW: + case GT_MetaGenerated_Tool_01.SAW -> { return SAWTOOL.SAW; - case GT_MetaGenerated_Tool_01.BUZZSAW_LV: - case GT_MetaGenerated_Tool_01.BUZZSAW_MV: - case GT_MetaGenerated_Tool_01.BUZZSAW_HV: + } + case GT_MetaGenerated_Tool_01.BUZZSAW_LV, GT_MetaGenerated_Tool_01.BUZZSAW_MV, GT_MetaGenerated_Tool_01.BUZZSAW_HV -> { return SAWTOOL.BUZZSAW; - case GT_MetaGenerated_Tool_01.CHAINSAW_LV: - case GT_MetaGenerated_Tool_01.CHAINSAW_MV: - case GT_MetaGenerated_Tool_01.CHAINSAW_HV: + } + case GT_MetaGenerated_Tool_01.CHAINSAW_LV, GT_MetaGenerated_Tool_01.CHAINSAW_MV, GT_MetaGenerated_Tool_01.CHAINSAW_HV -> { return SAWTOOL.CHAINSAW; + } } } return SAWTOOL.NONE; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java index 93442675ca..a526e61107 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/tesseract/TesseractHelper.java @@ -4,7 +4,6 @@ import static gtPlusPlus.core.lib.CORE.sTesseractGeneratorOwnershipMap; import static gtPlusPlus.core.lib.CORE.sTesseractTerminalOwnershipMap; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -38,10 +37,8 @@ public class TesseractHelper { // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 2"); Map generators = getGeneratorOwnershipByPlayer(player); Set> players = generators.entrySet(); - Iterator> i = players.iterator(); - while (i.hasNext()) { + for (Entry current : players) { // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 3"); - Entry current = i.next(); if (current.getValue().equals(generator)) { // Utils.LOG_WARNING("Success. [isGeneratorOwnedByPlayer] 4"); return true; @@ -64,7 +61,7 @@ public class TesseractHelper { Map playerOwned = sTesseractGeneratorOwnershipMap .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { - Map newOwnershipMap = new HashMap(); + Map newOwnershipMap = new HashMap<>(); newOwnershipMap.put(freq, generator); sTesseractGeneratorOwnershipMap.put(playerIdentifier, newOwnershipMap); Logger.WARNING("Success! [Empty Map]"); @@ -96,10 +93,8 @@ public class TesseractHelper { // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 1"); Map generators = getGeneratorOwnershipByPlayer(player); Set> players = generators.entrySet(); - Iterator> i = players.iterator(); - while (i.hasNext()) { + for (Entry current : players) { // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 2"); - Entry current = i.next(); if (current.getKey().equals(freq)) { // Utils.LOG_WARNING("Success. [getGeneratorByFrequency] 3"); Logger.WARNING("Success!"); @@ -142,9 +137,7 @@ public class TesseractHelper { if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { Map generators = getTerminalOwnershipByPlayer(player); Set> players = generators.entrySet(); - Iterator> i = players.iterator(); - while (i.hasNext()) { - Entry current = i.next(); + for (Entry current : players) { if (current.getValue().equals(generator)) { return true; } @@ -165,7 +158,7 @@ public class TesseractHelper { Map playerOwned = sTesseractTerminalOwnershipMap .get(playerIdentifier); if (playerOwned == null || playerOwned.isEmpty()) { - Map newOwnershipMap = new HashMap(); + Map newOwnershipMap = new HashMap<>(); newOwnershipMap.put(freq, generator); sTesseractTerminalOwnershipMap.put(playerIdentifier, newOwnershipMap); Logger.WARNING("Success! [Empty Map]"); @@ -195,9 +188,7 @@ public class TesseractHelper { if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { Map generators = getTerminalOwnershipByPlayer(player); Set> players = generators.entrySet(); - Iterator> i = players.iterator(); - while (i.hasNext()) { - Entry current = i.next(); + for (Entry current : players) { if (current.getKey().equals(freq)) { Logger.WARNING("Success!"); return current.getValue(); @@ -226,15 +217,13 @@ public class TesseractHelper { * Internal Methods * */ - private static final Map getGeneratorOwnershipByPlayer( + private static Map getGeneratorOwnershipByPlayer( EntityPlayer player) { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractGeneratorOwnershipMap.isEmpty() && playerIdentifier != null) { Set>> players = sTesseractGeneratorOwnershipMap .entrySet(); - Iterator>> i = players.iterator(); - while (i.hasNext()) { - Entry> current = i.next(); + for (Entry> current : players) { if (current.getKey().compareTo(playerIdentifier) == 0) { return current.getValue(); } @@ -243,15 +232,12 @@ public class TesseractHelper { return null; } - private static final Map getTerminalOwnershipByPlayer( - EntityPlayer player) { + private static Map getTerminalOwnershipByPlayer(EntityPlayer player) { UUID playerIdentifier = player.getUniqueID(); if (!sTesseractTerminalOwnershipMap.isEmpty() && playerIdentifier != null) { Set>> players = sTesseractTerminalOwnershipMap .entrySet(); - Iterator>> i = players.iterator(); - while (i.hasNext()) { - Entry> current = i.next(); + for (Entry> current : players) { if (current.getKey().compareTo(playerIdentifier) == 0) { return current.getValue(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java index 1a0a92b2ef..7126cb2480 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaCustomCoverItem.java @@ -65,7 +65,7 @@ public class MetaCustomCoverItem extends Item { return true; } - private final void registerCover() { + private void registerCover() { // CommonProxy.registerItemRendererGlobal(this, new CustomItemBlockRenderer()); for (int i = 0; i < icons.length; i++) { ItemStack thisStack = ItemUtils.simpleMetaStack(this, i, 1); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index d7eccc0d6b..e8690b155b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -1,30 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.items; -import static gregtech.api.enums.Textures.BlockIcons.*; -import static gregtech.client.GT_TooltipHandler.Tier.*; +import static gregtech.client.GT_TooltipHandler.Tier.EV; import static gregtech.client.GT_TooltipHandler.registerTieredTooltip; import static gtPlusPlus.core.util.Utils.getTcAspectStack; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; import gregtech.api.enums.TC_Aspects; import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; -import gregtech.common.covers.GT_Cover_Arm; -import gregtech.common.covers.GT_Cover_Conveyor; -import gregtech.common.covers.GT_Cover_Pump; -import gregtech.common.items.behaviors.Behaviour_DataOrb; -import gregtech.common.items.behaviors.Behaviour_DataStick; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.StringUtils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -52,12 +40,9 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { registerCustomCircuits(); - // Simplify life. - registerComponents_ULV(); - // Extruder Shape GregtechItemList.Shape_Extruder_WindmillShaft - .set(this.addItem(tLastID = 40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); + .set(this.addItem(40, "Extruder Shape (Shaft)", "Extruder Shape for making Windmill Shafts")); // Batteries GregtechItemList.Battery_RE_EV_Sodium.set( @@ -65,9 +50,9 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { tLastID = 50, "Quad Cell Sodium Battery", "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 2L), - getTcAspectStack(TC_Aspects.METALLUM, 2L), - getTcAspectStack(TC_Aspects.POTENTIA, 2L) })); + getTcAspectStack(TC_Aspects.ELECTRUM, 2L), + getTcAspectStack(TC_Aspects.METALLUM, 2L), + getTcAspectStack(TC_Aspects.POTENTIA, 2L))); this.setElectricStats(32000 + tLastID, 3200000L, GT_Values.V[4], 4L, -3L, true); registerTieredTooltip(GregtechItemList.Battery_RE_EV_Sodium.get(1), EV); @@ -76,9 +61,9 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { tLastID = 52, "Quad Cell Cadmium Battery", "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 1L), - getTcAspectStack(TC_Aspects.METALLUM, 1L), - getTcAspectStack(TC_Aspects.POTENTIA, 1L) })); + getTcAspectStack(TC_Aspects.ELECTRUM, 1L), + getTcAspectStack(TC_Aspects.METALLUM, 1L), + getTcAspectStack(TC_Aspects.POTENTIA, 1L))); this.setElectricStats(32000 + tLastID, 4800000L, GT_Values.V[4], 4L, -3L, true); registerTieredTooltip(GregtechItemList.Battery_RE_EV_Cadmium.get(1), EV); @@ -87,9 +72,9 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { tLastID = 54, "Quad Cell Lithium Battery", "Reusable", - new Object[] { getTcAspectStack(TC_Aspects.ELECTRUM, 3L), - getTcAspectStack(TC_Aspects.METALLUM, 3L), - getTcAspectStack(TC_Aspects.POTENTIA, 3L) })); +