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 --- .../java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 4 - .../xmod/gregtech/api/enums/GregtechItemList.java | 71 +-- .../gregtech/api/enums/GregtechOrePrefixes.java | 27 +- .../gregtech/api/items/Gregtech_MetaItem_Base.java | 9 +- .../xmod/gregtech/api/items/Gregtech_MetaTool.java | 5 +- ...etaTileEntity_Hatch_ElementalDataOrbHolder.java | 2 +- .../GT_MetaTileEntity_Hatch_InputBattery.java | 22 +- .../GT_MetaTileEntity_Hatch_Muffler_Adv.java | 5 +- .../GT_MetaTileEntity_Hatch_OutputBattery.java | 3 +- .../GT_MetaTileEntity_Hatch_Turbine.java | 5 +- .../GT_MetaTileEntity_Hatch_TurbineProvider.java | 13 +- .../base/GregtechMetaTransformerHiAmp.java | 4 +- .../base/GregtechMeta_MultiBlockBase.java | 28 +- .../base/GregtechMeta_SteamMultiBase.java | 14 +- .../GregtechRocketFuelGeneratorBase.java | 4 - .../GT_MetaTileEntity_Hatch_Catalysts.java | 2 +- .../GT_MetaTileEntity_Hatch_MillingBalls.java | 2 +- .../GT_MetaTileEntity_Hatch_NbtConsumable.java | 31 +- .../gregtech/api/objects/GregtechItemData.java | 20 +- .../api/util/SpecialBehaviourTooltipHandler.java | 2 +- .../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 ----- .../gregtech/loaders/ProcessingAngleGrinder.java | 4 +- .../loaders/ProcessingElectricButcherKnife.java | 142 ----- .../loaders/ProcessingElectricLighter.java | 139 ----- .../gregtech/loaders/ProcessingElectricSnips.java | 4 +- .../gregtech/loaders/RecipeGen_AlloySmelter.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Assembler.java | 2 +- .../gregtech/loaders/RecipeGen_BlastSmelter.java | 2 +- .../loaders/RecipeGen_BlastSmelterGT_GTNH.java | 6 +- .../gregtech/loaders/RecipeGen_DustGeneration.java | 4 +- .../xmod/gregtech/loaders/RecipeGen_Extruder.java | 2 +- .../gregtech/loaders/RecipeGen_FluidCanning.java | 10 +- .../xmod/gregtech/loaders/RecipeGen_Fluids.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Fluorite.java | 2 +- .../loaders/RecipeGen_MaterialProcessing.java | 6 +- .../gregtech/loaders/RecipeGen_MetalRecipe.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Ore.java | 10 +- .../xmod/gregtech/loaders/RecipeGen_Plasma.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Plates.java | 2 +- .../xmod/gregtech/loaders/RecipeGen_Recycling.java | 8 +- .../gregtech/loaders/RecipeGen_ShapedCrafting.java | 2 +- .../loaders/recipe/RecipeLoader_AlgaeFarm.java | 10 +- .../gregtech/loaders/recipe/RecipeLoader_LFTR.java | 6 +- .../recipe/RecipeLoader_MolecularTransformer.java | 3 +- .../registration/gregtech/Gregtech4Content.java | 69 -- .../gregtech/GregtechBufferDynamos.java | 2 +- .../registration/gregtech/GregtechConduits.java | 7 +- .../gregtech/GregtechCustomHatches.java | 24 +- .../gregtech/GregtechGeneratorsULV.java | 52 -- .../gregtech/GregtechPollutionDevices.java | 6 - .../gregtech/GregtechSteamCondenser.java | 22 - .../registration/gregtech/GregtechSuperChests.java | 8 - .../gregtech/GregtechTieredChunkloaders.java | 26 - .../gregtech/GregtechWirelessChargers.java | 2 +- 122 files changed, 743 insertions(+), 4399 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 delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricButcherKnife.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingElectricLighter.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeneratorsULV.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTieredChunkloaders.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 977eb8a2c9..1a188153d5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -37,8 +37,6 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_ElementalDuplicator; import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngleGrinder; -import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife; -import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricLighter; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; import gtPlusPlus.xmod.gregtech.loaders.misc.AddCustomMachineToPA; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; @@ -80,8 +78,6 @@ public class HANDLER_GT { // Only loads if the config option is true (default: true) new ProcessingAngleGrinder().run(); new ProcessingElectricSnips().run(); - new ProcessingElectricButcherKnife().run(); - new ProcessingElectricLighter().run(); // Register custom singles to the PA AddCustomMachineToPA.register(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index 90fd1e2358..ed2bc20c32 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -53,18 +53,7 @@ public enum GregtechItemList implements GregtechItemContainer { Sensor_ZPM, Sensor_UV, - // ULV Components - Electric_Motor_ULV, - Electric_Pump_ULV, - Conveyor_Module_ULV, - Electric_Piston_ULV, - Robot_Arm_ULV, - Field_Generator_ULV, - Emitter_ULV, - Sensor_ULV, - // Mixed Components - TransmissionComponent_ULV, TransmissionComponent_LV, TransmissionComponent_MV, TransmissionComponent_HV, @@ -73,7 +62,7 @@ public enum GregtechItemList implements GregtechItemContainer { TransmissionComponent_LuV, TransmissionComponent_ZPM, TransmissionComponent_UV, - TransmissionComponent_MAX, + TransmissionComponent_UHV, // Recipe Circuit Circuit_BioRecipeSelector, @@ -176,13 +165,6 @@ public enum GregtechItemList implements GregtechItemContainer { Laser_Lens_WoodsGlass, Laser_Lens_Special, - // Bombs - Bomb_Cast, - Bomb_Cast_Molten, - Bomb_Cast_Set, - Bomb_Cast_Broken, - Bomb_Cast_Mold, - // Pellet Mold Pellet_Mold, @@ -210,7 +192,7 @@ public enum GregtechItemList implements GregtechItemContainer { GTPP_Casing_LuV, GTPP_Casing_ZPM, GTPP_Casing_UV, - GTPP_Casing_MAX, + GTPP_Casing_UHV, // IronBlastFurnace Machine_Bronze_BlastFurnace Casing_IronPlatedBricks, @@ -552,7 +534,6 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Muffler_Adv_MAX, // Super Input Busses - Hatch_SuperBus_Input_ULV, Hatch_SuperBus_Input_LV, Hatch_SuperBus_Input_MV, Hatch_SuperBus_Input_HV, @@ -564,7 +545,6 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_SuperBus_Input_MAX, // Super Output Busses - Hatch_SuperBus_Output_ULV, Hatch_SuperBus_Output_LV, Hatch_SuperBus_Output_MV, Hatch_SuperBus_Output_HV, @@ -576,10 +556,9 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_SuperBus_Output_MAX, // Chisel Buses for Industrial Chisel - GT_MetaTileEntity_ChiselBus_I, - GT_MetaTileEntity_ChiselBus_II, - GT_MetaTileEntity_ChiselBus_III, - GT_MetaTileEntity_ChiselBus_IV, + GT_MetaTileEntity_ChiselBus_LV, + GT_MetaTileEntity_ChiselBus_MV, + GT_MetaTileEntity_ChiselBus_HV, // ---------------------------------------------------------------------------- @@ -602,11 +581,6 @@ public enum GregtechItemList implements GregtechItemContainer { * Single Block Tile Entities */ - // ULV Generators - Generator_Diesel_ULV, - Generator_Gas_Turbine_ULV, - Generator_Steam_Turbine_ULV, - // Crate Box CrateStorage, @@ -616,17 +590,6 @@ public enum GregtechItemList implements GregtechItemContainer { // infinite Items Infinite_Item_Chest, - // GT4 Redstone - GT4_Redstone_Lamp, - GT4_Redstone_Button_Panel, - GT4_Redstone_Scale, - GT4_Redstone_Display, - GT4_Redstone_Circuit, - - // Gt4 Workbenches - GT4_Workbench_Bronze, - GT4_Workbench_Advanced, - // GT4 automation GT4_Electric_Auto_Workbench_LV, GT4_Electric_Auto_Workbench_MV, @@ -671,7 +634,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Fancy Pollution Devices Pollution_Detector, - Pollution_Cleaner_ULV, Pollution_Cleaner_LV, Pollution_Cleaner_MV, Pollution_Cleaner_HV, @@ -702,11 +664,6 @@ public enum GregtechItemList implements GregtechItemContainer { Super_Chest_EV, Super_Chest_IV, - // Chunkloader - GT_Chunkloader_HV, - GT_Chunkloader_ZPM, - GT_Chunkloader_IV, - // Wireless Chargers Charger_LV, Charger_MV, @@ -716,7 +673,7 @@ public enum GregtechItemList implements GregtechItemContainer { Charger_LuV, Charger_ZPM, Charger_UV, - Charger_MAX, + Charger_UHV, // Reactor Processing Unit ReactorProcessingUnit_IV, @@ -752,21 +709,6 @@ public enum GregtechItemList implements GregtechItemContainer { Energy_Buffer_1by1_UV, Energy_Buffer_1by1_MAX, - // Cobble Generators - Cobble_Generator_ULV, - Cobble_Generator_LV, - Cobble_Generator_MV, - Cobble_Generator_HV, - Cobble_Generator_EV, - Cobble_Generator_IV, - Cobble_Generator_LuV, - Cobble_Generator_ZPM, - Cobble_Generator_UV, - Cobble_Generator_MAX, - - // The max Steam condenser - Condensor_MAX, - // Rocket Engines Rocket_Engine_EV, Rocket_Engine_IV, @@ -856,7 +798,6 @@ public enum GregtechItemList implements GregtechItemContainer { */ // Fluid Void Covers - Cover_Overflow_ULV, Cover_Overflow_LV, Cover_Overflow_MV, Cover_Overflow_HV, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 61abc48a18..03ec5f3fc5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -109,7 +109,7 @@ public enum GregtechOrePrefixes { chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced ; - public static volatile int VERSION = 508; + public static final int VERSION = 508; static { ingotHot.mHeatDamage = 3.0F; @@ -132,11 +132,11 @@ public enum GregtechOrePrefixes { mGeneratedItems = new HashSet<>(); private final ArrayList mOreProcessing = new ArrayList<>(); private final ArrayList mOreProcessingFake = new ArrayList<>(); - public ItemStack mContainerItem = null; - public ICondition mCondition = null; + public final ItemStack mContainerItem = null; + public final ICondition mCondition = null; public byte mDefaultStackSize = 64; - public GregtechMaterialStack mSecondaryMaterial = null; - public GregtechOrePrefixes mPrefixInto = this; + public final GregtechMaterialStack mSecondaryMaterial = null; + public final GregtechOrePrefixes mPrefixInto = this; public float mHeatDamage = 0.0F; // Negative for Frost Damage /** * Yes this Value can be changed to add Bits for the MetaGenerated-Item-Check. @@ -657,15 +657,22 @@ public enum GregtechOrePrefixes { mOreMultiplier = 1, mByProductMultiplier = 1, mSmeltingMultiplier = 1; public long mDensity = M; public Element mElement = null; - public GT_Materials mDirectSmelting = this, mOreReplacement = this, mMacerateInto = this, mSmeltInto = this, - mArcSmeltInto = this, mHandleMaterial = this; + public GT_Materials mDirectSmelting = this; + public GT_Materials mOreReplacement = this; + public GT_Materials mMacerateInto = this; + public GT_Materials mSmeltInto = this; + public GT_Materials mArcSmeltInto = this; + public final GT_Materials mHandleMaterial = this; public byte mToolQuality = 0; - public Fluid mSolid = null, mFluid = null, mGas = null, mPlasma = null; + public final Fluid mSolid = null; + public Fluid mFluid = null; + public Fluid mGas = null; + public Fluid mPlasma = null; /** * This Fluid is used as standard Unit for Molten Materials. 1296 is a Molten Block, what means 144 is one * Material Unit worth */ - public Fluid mStandardMoltenFluid = null; + public final Fluid mStandardMoltenFluid = null; private GT_Materials(final int aMetaItemSubID, final TextureSet aIconSet, final float aToolSpeed, final int aToolDurability, final int aToolQuality, final boolean aUnificatable) { @@ -1283,6 +1290,6 @@ public enum GregtechOrePrefixes { return this.mRGBa; } - public static volatile int VERSION = 508; + public static final int VERSION = 508; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java index 5437f65aff..e6f7933fd7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java @@ -294,7 +294,9 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item + " / " + GT_Utility.formatNumbers(Math.abs(tStats[0])) + " EU - Voltage: " - + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 : 1)] + + GT_Utility.formatNumbers( + V[(int) (tStats[2] >= 0 ? tStats[2] < V.length ? tStats[2] : V.length - 1 + : 1)]) + EnumChatFormatting.GRAY); } } @@ -308,7 +310,10 @@ public abstract class Gregtech_MetaItem_Base extends Gregtech_Generic_Item + ((tFluid == null ? "No Fluids Contained" : GT_Utility.getFluidName(tFluid, true))) + EnumChatFormatting.GRAY); aList.add( - EnumChatFormatting.BLUE + ((tFluid == null ? 0 : tFluid.amount) + "L / " + tStats[0] + "L") + EnumChatFormatting.BLUE + + (GT_Utility.formatNumbers(tFluid == null ? 0 : tFluid.amount) + "L / " + + GT_Utility.formatNumbers(tStats[0]) + + "L") + EnumChatFormatting.GRAY); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java index a66cce394d..259aa2760c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java @@ -480,10 +480,7 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool } this.doDamage(aStack, tStats.getToolDamagePerContainerCraft()); aStack = aStack.stackSize > 0 ? aStack : null; - if (playSound) { - // String sound = (aStack == null) ? tStats.getBreakingSound() : tStats.getCraftingSound(); - // GT_Utility.doSoundAtClient(sound, 1, 1.0F); - } + if (playSound) {} return aStack; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index 6a8b3a9af6..68aaa75aa1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -150,7 +150,7 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE } public ArrayList getInventory() { - ArrayList aContents = new ArrayList(); + ArrayList aContents = new ArrayList<>(); for (int i = getBaseMetaTileEntity().getSizeInventory() - 2; i >= 0; i--) { if (getBaseMetaTileEntity().getStackInSlot(i) != null) aContents.add(getBaseMetaTileEntity().getStackInSlot(i)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 1fca67d295..254c81a515 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -128,8 +128,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc fillStacksIntoFirstSlots(); } if (aBaseMetaTileEntity.isServerSide()) { - if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) { - MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity(); + if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity mMetaTileEntity) { if (mMetaTileEntity.rechargerSlotCount() > 0 && aBaseMetaTileEntity.getStoredEU() > 0) { for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) { @@ -149,11 +148,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc } } } - } else { - // Utils.LOG_INFO("reCharger Slot Count = "+mMetaTileEntity.rechargerSlotCount()); - // Utils.LOG_INFO("getStoredEU = "+aBaseMetaTileEntity.getStoredEU()); - // Utils.LOG_INFO("getEUVar = "+mMetaTileEntity.getEUVar()); - } + } else {} } } super.onPostTick(aBaseMetaTileEntity, aTimer); @@ -202,14 +197,11 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc @Override public int rechargerSlotCount() { - switch (mTier) { - case 2: - return 4; - case 4: - return 16; - default: - return 16; - } + return switch (mTier) { + case 2 -> 4; + case 4 -> 16; + default -> 16; + }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java index d8ec187fff..8c0ebe60e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java @@ -195,10 +195,7 @@ public class GT_MetaTileEntity_Hatch_Muffler_Adv extends GT_MetaTileEntity_Hatch // return; } else { // Logger.INFO("B2"); - if (this.getInventoryStack() == null) { - // Logger.INFO("D1"); - // Logger.INFO("Empty - "+this.mInventory.length); - } else { + if (this.getInventoryStack() == null) {} else { // Logger.INFO("D2"); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index 502dd0ee0b..f70be9aa89 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -174,8 +174,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat } if (aBaseMetaTileEntity.isServerSide()) { - if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity) { - MetaTileEntity mMetaTileEntity = (MetaTileEntity) aBaseMetaTileEntity.getMetaTileEntity(); + if (aBaseMetaTileEntity.getMetaTileEntity() instanceof MetaTileEntity mMetaTileEntity) { if (mMetaTileEntity.dechargerSlotCount() > 0 && mMetaTileEntity.getEUVar() < aBaseMetaTileEntity.getEUCapacity()) { for (int i = mMetaTileEntity.dechargerSlotStartIndex(), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java index e8ef0a454b..0d307f6e0f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java @@ -30,7 +30,6 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; @@ -172,7 +171,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { } } - private final int getDamageToComponent(ItemStack aStack) { + private int getDamageToComponent(ItemStack aStack) { return 1; } @@ -334,7 +333,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { PlayerUtils.messagePlayer(aPlayer, "Using: " + aMat.mLocalizedName + " " + aSize); } } else { - this.mUsingAnimation = Utils.invertBoolean(mUsingAnimation); + this.mUsingAnimation = !mUsingAnimation; if (this.mUsingAnimation) { PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java index 226086a1ff..e6cb5f8132 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -20,7 +20,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_LargeTurbine; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; @@ -64,20 +63,18 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H } } - private final void tryFindParentTurbine() { + private void tryFindParentTurbine() { Logger.INFO("This turbine housing has no parent, searching world."); IGregTechTileEntity T = this.getBaseMetaTileEntity(); World W = T.getWorld(); Chunk C = W.getChunkFromBlockCoords(T.getXCoord(), T.getZCoord()); for (Object o : C.chunkTileEntityMap.values()) { - if (o instanceof IGregTechTileEntity) { - IGregTechTileEntity G = (IGregTechTileEntity) o; + if (o instanceof IGregTechTileEntity G) { final IMetaTileEntity aMetaTileEntity = G.getMetaTileEntity(); if (aMetaTileEntity == null) { continue; } - if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine) { - GT_MetaTileEntity_LargeTurbine aTurb = (GT_MetaTileEntity_LargeTurbine) aMetaTileEntity; + if (aMetaTileEntity instanceof GT_MetaTileEntity_LargeTurbine aTurb) { for (GT_MetaTileEntity_Hatch_InputBus ee : aTurb.mInputBusses) { if (ee.equals(this)) { mParent = aTurb; @@ -90,7 +87,7 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H } } - private final void tryRefillTurbine() { + private void tryRefillTurbine() { if (mParent == null) { tryFindParentTurbine(); } @@ -166,7 +163,7 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aPlayer != null) { if (KeyboardUtils.isCtrlKeyDown()) { - mDescending = Utils.invertBoolean(mDescending); + mDescending = !mDescending; PlayerUtils.messagePlayer(aPlayer, "Direction: " + (mDescending ? "DOWN" : "UP")); } else { int aAmount = 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index a9dd8d3a97..3701f5dd0f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -12,7 +12,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Transformer; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.PlayerUtils; public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer { @@ -108,11 +107,10 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) { - this.mHalfMode = Utils.invertBoolean(mHalfMode); + this.mHalfMode = !mHalfMode; if (this.mHalfMode) { PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 2A:8A in/out Ratio."); } else { - PlayerUtils.messagePlayer(aPlayer, "Transformer is now running at 4A:16A in/out Ratio."); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index fe394238a6..01e0f731f6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -561,35 +561,29 @@ public abstract class GregtechMeta_MultiBlockBase { this.mWrench = false; b = true; - break; } - case 1: { + case 1 -> { this.mScrewdriver = false; b = true; - break; } - case 2: { + case 2 -> { this.mSoftHammer = false; b = true; - break; } - case 3: { + case 3 -> { this.mHardHammer = false; b = true; - break; } - case 4: { + case 4 -> { this.mSolderingTool = false; b = true; - break; } - case 5: { + case 5 -> { this.mCrowbar = false; b = true; - break; } } return b; @@ -1018,8 +1012,7 @@ public abstract class GregtechMeta_MultiBlockBase 10) { mStartUpCheck = 10; } */ @@ -1251,7 +1243,7 @@ public abstract class GregtechMeta_MultiBlockBase IStructureElement addTieredBlock(Block aBlock, BiPredicate aSetTheMeta, Function aGetTheMeta, int minMeta, int maxMeta) { - return new IStructureElement() { + return new IStructureElement<>() { @Override public boolean check(T t, World world, int x, int y, int z) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index cd23f036da..d4db6b1350 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -32,9 +32,9 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn public abstract class GregtechMeta_SteamMultiBase> extends GregtechMeta_MultiBlockBase { - public ArrayList mSteamInputs = new ArrayList(); - public ArrayList mSteamOutputs = new ArrayList(); - public ArrayList mSteamInputFluids = new ArrayList(); + public ArrayList mSteamInputs = new ArrayList<>(); + public ArrayList mSteamOutputs = new ArrayList<>(); + public ArrayList mSteamInputFluids = new ArrayList<>(); protected static final String TT_steaminputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamInputBus"); protected static final String TT_steamoutputbus = StatCollector.translateToLocal("GTPP.MBTT.SteamOutputBus"); @@ -80,7 +80,7 @@ public abstract class GregtechMeta_SteamMultiBase getAllSteamStacks() { - ArrayList aFluids = new ArrayList(); + ArrayList aFluids = new ArrayList<>(); FluidStack aSteam = FluidUtils.getSteam(1); for (FluidStack aFluid : this.getStoredFluids()) { if (aFluid.isFluidEqual(aSteam)) { @@ -231,7 +231,7 @@ public abstract class GregtechMeta_SteamMultiBase getStoredFluids() { - ArrayList rList = new ArrayList(); + ArrayList rList = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_CustomFluidBase tHatch : mSteamInputFluids) { if (isValidMetaTileEntity(tHatch) && tHatch.getFillableStack() != null) { rList.add(tHatch.getFillableStack()); @@ -242,7 +242,7 @@ public abstract class GregtechMeta_SteamMultiBase getStoredInputs() { - ArrayList rList = new ArrayList(); + ArrayList rList = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Steam_BusInput tHatch : mSteamInputs) { tHatch.mRecipeMap = getRecipeMap(); if (isValidMetaTileEntity(tHatch)) { @@ -282,7 +282,7 @@ public abstract class GregtechMeta_SteamMultiBase getStoredOutputs() { - ArrayList rList = new ArrayList(); + ArrayList rList = new ArrayList<>(); for (GT_MetaTileEntity_Hatch_Steam_BusOutput tHatch : mSteamOutputs) { if (isValidMetaTileEntity(tHatch)) { for (int i = tHatch.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java index 0200113e95..cab45a9a7b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java @@ -319,10 +319,6 @@ public abstract class GregtechRocketFuelGeneratorBase extends GT_MetaTileEntity_ // Logger.INFO("Found some fuel?"); int aperOp = this.consumedFluidPerOperation(tLiquid); int aConsume = (int) (((long) tFuel.mSpecialValue * this.getEfficiency() * aperOp) / 100); - // Logger.INFO("Fuel Value: "+tFuel.mSpecialValue); - // Logger.INFO("Efficiency: "+getEfficiency()); - // Logger.INFO("Consumed per op: "+aperOp); - // Logger.INFO("Consuming "+aConsume); return aConsume; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java index 9bf0ad3f53..b53e540044 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_Hatch_Catalysts extends GT_MetaTileEntity_Hatch_N @Override public AutoMap getItemsValidForUsageSlots() { - return new AutoMap(); + return new AutoMap<>(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java index 240ed3624f..e3134f5812 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java @@ -56,7 +56,7 @@ public class GT_MetaTileEntity_Hatch_MillingBalls extends GT_MetaTileEntity_Hatc @Override public AutoMap getItemsValidForUsageSlots() { - return new AutoMap(); + return new AutoMap<>(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java index 5555d1ff09..53c988676f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java @@ -169,7 +169,7 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE } public final AutoMap getContentUsageSlots() { - AutoMap aItems = new AutoMap(); + AutoMap aItems = new AutoMap<>(); for (int i = mInputslotCount; i < mTotalSlotCount; i++) { if (mInventory[i] != null) { aItems.add(mInventory[i]); @@ -279,24 +279,19 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE @Override public void addGregTechLogo(ModularWindow.Builder builder) { switch (mTotalSlotCount) { - case 8: - case 18: - builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) - .setPos(152, 63)); - break; - case 32: - builder.widget( - new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) - .setPos(79, 35)); - break; + case 8, 18 -> builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) + .setPos(152, 63)); + case 32 -> builder.widget( + new DrawableWidget().setDrawable(getGUITextureSet().getGregTechLogo()).setSize(17, 17) + .setPos(79, 35)); } } @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { switch (mTotalSlotCount) { - case 8: + case 8 -> { builder.widget( SlotGroup.ofItemHandler(inventoryHandler, 2).startFromSlot(0).endAtSlot(3).build() .setPos(25, 25)); @@ -305,8 +300,8 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE .build().setPos(115, 25)); builder.widget(new TextWidget("Stock").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(25, 16)) .widget(new TextWidget("Active").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(115, 16)); - break; - case 18: + } + case 18 -> { builder.widget( SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(0).endAtSlot(8).build() .setPos(25, 19)); @@ -315,15 +310,15 @@ public abstract class GT_MetaTileEntity_Hatch_NbtConsumable extends GT_MetaTileE .build().setPos(97, 19)); builder.widget(new TextWidget("Stock").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(25, 14)) .widget(new TextWidget("Active").setDefaultColor(COLOR_TEXT_GRAY.get()).setPos(15, 14)); - break; - case 32: + } + case 32 -> { builder.widget( SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(0).endAtSlot(15).build() .setPos(7, 7)); builder.widget( SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(16).endAtSlot(31).canInsert(false) .build().setPos(96, 7)); - break; + } } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java index b9dc5d4b70..77ad6cd4ac 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java @@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.objects; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; import java.util.List; import net.minecraft.item.ItemStack; @@ -47,9 +45,9 @@ public class GregtechItemData { final GregtechMaterialStack[] tByProducts = aByProducts.length < 1 ? EMPTY_GT_MaterialStack_ARRAY : new GregtechMaterialStack[aByProducts.length]; int j = 0; - for (int i = 0; i < aByProducts.length; i++) { - if ((aByProducts[i] != null) && (aByProducts[i].mMaterial != null)) { - tByProducts[j++] = aByProducts[i].clone(); + for (GregtechMaterialStack aByProduct : aByProducts) { + if ((aByProduct != null) && (aByProduct.mMaterial != null)) { + tByProducts[j++] = aByProduct.clone(); } } this.mByProducts = j > 0 ? new GregtechMaterialStack[j] : EMPTY_GT_MaterialStack_ARRAY; @@ -102,13 +100,7 @@ public class GregtechItemData { } } - Collections.sort(rList, new Comparator() { - - @Override - public int compare(final GregtechMaterialStack a, final GregtechMaterialStack b) { - return a.mAmount == b.mAmount ? 0 : a.mAmount > b.mAmount ? -1 : +1; - } - }); + rList.sort((a, b) -> Long.compare(b.mAmount, a.mAmount)); if (rList.isEmpty()) { this.mMaterial = null; @@ -117,7 +109,7 @@ public class GregtechItemData { rList.remove(0); } - this.mByProducts = rList.toArray(new GregtechMaterialStack[rList.size()]); + this.mByProducts = rList.toArray(new GregtechMaterialStack[0]); } public boolean hasValidPrefixMaterialData() { @@ -133,7 +125,7 @@ public class GregtechItemData { } public ArrayList getAllGT_MaterialStacks() { - final ArrayList rList = new ArrayList(); + final ArrayList rList = new ArrayList<>(); if (this.hasValidMaterialData()) { rList.add(this.mMaterial); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java index 51987d84fd..df95b7de2b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/util/SpecialBehaviourTooltipHandler.java @@ -11,7 +11,7 @@ import gregtech.api.util.GT_Utility; public class SpecialBehaviourTooltipHandler { - private static final HashMap mTooltipCache = new HashMap(); + private static final HashMap mTooltipCache = new HashMap<>(); public static void addTooltipForItem(ItemStack aStack, String aTooltip) { mTooltipCache.put(aStack, aTooltip); 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.MACHI