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 --- .../xmod/bartcrops/LoaderOfTheCrops.java | 26 +- .../bartcrops/abstracts/BaseAestheticCrop.java | 22 +- .../xmod/bartcrops/abstracts/BaseCrop.java | 2 +- .../bartcrops/abstracts/BaseHarvestableCrop.java | 22 +- .../xmod/bop/blocks/base/LeavesBase.java | 8 +- .../gtPlusPlus/xmod/bop/blocks/base/LogBase.java | 2 +- .../xmod/bop/blocks/base/SaplingBase.java | 27 +- .../java/gtPlusPlus/xmod/forestry/HANDLER_FR.java | 38 -- .../xmod/forestry/bees/custom/CustomCombs.java | 8 +- .../xmod/forestry/bees/handler/GTPP_CombType.java | 12 +- .../xmod/forestry/bees/handler/GTPP_DropType.java | 10 +- .../forestry/bees/handler/GTPP_PollenType.java | 10 +- .../forestry/bees/handler/GTPP_PropolisType.java | 10 +- .../xmod/forestry/bees/items/FR_ItemRegistry.java | 3 - .../xmod/forestry/bees/items/FR_StringUtil.java | 6 - .../forestry/bees/registry/GTPP_BeeDefinition.java | 114 ++-- .../xmod/forestry/bees/registry/GTPP_Bees.java | 10 +- .../bees/registry/GTPP_BranchDefinition.java | 2 +- .../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 +- .../java/gtPlusPlus/xmod/ic2/item/IC2_Items.java | 3 - .../java/gtPlusPlus/xmod/ob/GliderHandler.java | 126 ---- .../gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java | 20 - .../thaumcraft/commands/CommandDumpAspects.java | 5 +- .../thaumcraft/objects/ThreadAspectScanner.java | 11 +- .../gtPlusPlus/xmod/tinkers/HANDLER_Tinkers.java | 8 +- .../xmod/tinkers/material/BaseTinkersMaterial.java | 45 +- .../xmod/tinkers/util/TinkersDryingRecipe.java | 2 +- .../gtPlusPlus/xmod/tinkers/util/TinkersUtils.java | 220 +------ 149 files changed, 886 insertions(+), 5028 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 delete mode 100644 src/main/java/gtPlusPlus/xmod/ob/GliderHandler.java delete mode 100644 src/main/java/gtPlusPlus/xmod/ob/HANDLER_OpenBlocks.java (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java index e1b1d53b45..c3c2f0b6cc 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java @@ -19,7 +19,7 @@ import ic2.api.crops.Crops; */ public class LoaderOfTheCrops { - private static List mHasCropObj = new ArrayList(); + private static List mHasCropObj = new ArrayList<>(); private CropCard mCropObj; private ItemStack mBaseSeed; private static List mCropList = cropLoader(); @@ -46,35 +46,35 @@ public class LoaderOfTheCrops { } public static List cropLoader() { - List p = new ArrayList(); + List p = new ArrayList<>(); p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3))); return p; } - private static final List cropObjs() { - List p = new ArrayList(); + private static List cropObjs() { + List p = new ArrayList<>(); - for (int i = 0; i < mCropList.size(); ++i) { - p.add(cropUnpackerCC((LoaderOfTheCrops) mCropList.get(i))); + for (LoaderOfTheCrops loaderOfTheCrops : mCropList) { + p.add(cropUnpackerCC((LoaderOfTheCrops) loaderOfTheCrops)); } return p; } - private static final List setBaseSeed() { - List p = new ArrayList(); + private static List setBaseSeed() { + List p = new ArrayList<>(); - for (int i = 0; i < mCropList.size(); ++i) { - p.add(cropUnpackerCG((LoaderOfTheCrops) mCropList.get(i))); + for (LoaderOfTheCrops loaderOfTheCrops : mCropList) { + p.add(cropUnpackerCG((LoaderOfTheCrops) loaderOfTheCrops)); } return p; } - private static final List setnames() { - List s = new ArrayList(); + private static List setnames() { + List s = new ArrayList<>(); for (int i = 0; i < mCropList.size(); ++i) { s.add(((CropCard) cropObjs().get(i)).name()); @@ -98,7 +98,7 @@ public class LoaderOfTheCrops { } public static void registerBaseSeed() { - List baseseed = new ArrayList(setBaseSeed()); + List baseseed = new ArrayList<>(setBaseSeed()); for (int i = 0; i < mCropList.size(); ++i) { if (baseseed.get(i) != null && cropObjs().get(i) != null) { diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java index 60d4601132..c794c40878 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseAestheticCrop.java @@ -12,20 +12,14 @@ public abstract class BaseAestheticCrop extends BaseHarvestableCrop { @Override public int stat(int n) { - switch (n) { - case 0: - return 0; - case 1: - return 0; - case 2: - return 0; - case 3: - return 4; - case 4: - return 0; - default: - return 0; - } + return switch (n) { + case 0 -> 0; + case 1 -> 0; + case 2 -> 0; + case 3 -> 4; + case 4 -> 0; + default -> 0; + }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java index dec6413a82..22fce2ae5a 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java @@ -56,7 +56,7 @@ public abstract class BaseCrop extends CropCard implements ICropCardInfo { @Override public List getCropInformation() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add(Arrays.toString(this.attributes())); return ret; } diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java index f5daa20fdf..80325edff0 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseHarvestableCrop.java @@ -12,20 +12,14 @@ public abstract class BaseHarvestableCrop extends BaseCrop { @Override public int stat(int n) { - switch (n) { - case 0: - return 0; - case 1: - return 4; - case 2: - return 0; - case 3: - return 4; - case 4: - return 0; - default: - return 0; - } + return switch (n) { + case 0 -> 0; + case 1 -> 4; + case 2 -> 0; + case 3 -> 4; + case 4 -> 0; + default -> 0; + }; } @Override diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java index 3fb8229b7f..3e7a6a0105 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java +++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LeavesBase.java @@ -40,7 +40,7 @@ public class LeavesBase extends BlockLeaves { Blocks.fire.setFireInfo(this, 80, 150); } - private final void setVanillaVariable(Object toSet, Object value) { + private void setVanillaVariable(Object toSet, Object value) { toSet = value; } @@ -52,9 +52,9 @@ public class LeavesBase extends BlockLeaves { @Override // Drops when Leaf is broken protected void func_150124_c(World world, int x, int y, int z, int meta, int randomChance) { Logger.INFO("Dropping Bonus Drops"); - for (int i = 0; i < this.bonusDrops.length; ++i) { - if (this.bonusDrops[i] != null && world.rand.nextInt(randomChance) == 0) { - this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(this.bonusDrops[i], 1)); + for (ItemStack bonusDrop : this.bonusDrops) { + if (bonusDrop != null && world.rand.nextInt(randomChance) == 0) { + this.dropBlockAsItem(world, x, y, z, ItemUtils.getSimpleStack(bonusDrop, 1)); } } } diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java index 6c4ea6a556..3270fea55b 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java +++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/LogBase.java @@ -40,7 +40,7 @@ public abstract class LogBase extends BlockLog { Blocks.fire.setFireInfo(this, 20, 100); } - private final void setVanillaVariable(Object toSet, Object value) { + private void setVanillaVariable(Object toSet, Object value) { toSet = value; } diff --git a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java index 1c1cd515bb..51dd580ab4 100644 --- a/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java +++ b/src/main/java/gtPlusPlus/xmod/bop/blocks/base/SaplingBase.java @@ -48,7 +48,7 @@ public class SaplingBase extends BlockSapling { this.setCreativeTab(AddToCreativeTab.tabBOP); } - private final void setVanillaVariable(Object toSet, Object value) { + private void setVanillaVariable(Object toSet, Object value) { toSet = value; } @@ -121,33 +121,12 @@ public class SaplingBase extends BlockSapling { int j1 = 0; boolean flag = false; - switch (l) { - case 0: - default: - Logger.WARNING("Case 0 - Grow Tree"); - break; - } - Block block = Blocks.air; - if (flag) { - world.setBlock(x + i1, y, z + j1, block, 0, 4); - world.setBlock(x + i1 + 1, y, z + j1, block, 0, 4); - world.setBlock(x + i1, y, z + j1 + 1, block, 0, 4); - world.setBlock(x + i1 + 1, y, z + j1 + 1, block, 0, 4); - } else { - world.setBlock(x, y, z, block, 0, 4); - } + world.setBlock(x, y, z, block, 0, 4); if (!((WorldGenerator) object).generate(world, rand, x + i1, y, z + j1)) { - if (flag) { - world.setBlock(x + i1, y, z + j1, this, l, 4); - world.setBlock(x + i1 + 1, y, z + j1, this, l, 4); - world.setBlock(x + i1, y, z + j1 + 1, this, l, 4); - world.setBlock(x + i1 + 1, y, z + j1 + 1, this, l, 4); - } else { - world.setBlock(x, y, z, this, l, 4); - } + world.setBlock(x, y, z, this, l, 4); } } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java index 0b9702acb1..80d1620f02 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java @@ -3,12 +3,7 @@ package gtPlusPlus.xmod.forestry; import static gregtech.api.enums.Mods.ExtraTrees; import static gregtech.api.enums.Mods.Forestry; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.world.World; import binnie.extratrees.genetics.ExtraTreeSpecies; import cpw.mods.fml.common.Optional; @@ -43,39 +38,6 @@ public class HANDLER_FR { } } - public static boolean createBlockBreakParticles(final World world, final int x, final int y, final int z, - final Block block) { - if (Forestry.isModLoaded()) { - createBlockBreakParticles_INTERNAL(world, x, y, z, block); - } - return false; - } - - @Optional.Method(modid = Mods.Names.FORESTRY) - private static void createBlockBreakParticles_INTERNAL(final World world, final int x, final int y, final int z, - final Block block) { - if (Forestry.isModLoaded()) { - Class oClass; - try { - oClass = ReflectionUtils.getClass("forestry.core.proxy.ProxyCommon"); - Object oProxy = ReflectionUtils.getField(oClass, "common"); - if (oProxy != null && oClass.isInstance(oProxy)) { - Method mParticles = ReflectionUtils.getMethod( - oClass, - "addBlockDestroyEffects", - World.class, - int.class, - int.class, - int.class, - Block.class, - int.class); - mParticles.invoke(oProxy, world, x, y, z, block, 0); - } - } catch (SecurityException | IllegalAccessException | IllegalArgumentException - | InvocationTargetException e) {} - } - } - @Optional.Method(modid = Mods.Names.FORESTRY) private static void mapForestrySaplingToLog() { for (TreeDefinition value : TreeDefinition.values()) { diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java index 031061bfc3..94f61296d6 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/custom/CustomCombs.java @@ -34,7 +34,7 @@ public enum CustomCombs { SALT("salt", true, Materials.Salt, 75), SAND("sand", true, Materials.Sand, 100),; - private static int[][] colours = new int[][] { + private static final int[][] colours = new int[][] { { Utils.rgbtoHexValue(75, 75, 75), Utils.rgbtoHexValue(125, 125, 125) }, // SILICON { Utils.rgbtoHexValue(55, 55, 55), Utils.rgbtoHexValue(75, 75, 75) }, // RUBBER { Utils.rgbtoHexValue(245, 245, 245), Utils.rgbtoHexValue(175, 175, 175) }, // PLASTIC @@ -65,9 +65,9 @@ public enum CustomCombs { { 0xEBA1EB, 0xF2C3F2 }, { 0x62626D, 0x161620 }, { 0xE6E6E6, 0xFFFFCC }, { 0xDADADA, 0xD1D1E0 }, { 0x19AF19, 0x169E16 }, { 0x335C33, 0x6B8F00 }, { 0x003300, 0x002400 }, }; public boolean showInList; - public Materials material; - public int chance; - private String name; + public final Materials material; + public final int chance; + private final String name; private CustomCombs(String pName, boolean show, Materials material, int chance) { this.name = pName; diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java index 3495869c97..4bc47fa7bd 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java @@ -13,13 +13,13 @@ public enum GTPP_CombType { FORCE(1, "Force", true, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5)); public boolean mShowInList; - public Material mMaterial; - public int mChance; - public int mID; + public final Material mMaterial; + public final int mChance; + public final int mID; - private String mName; - private String mNameUnlocal; - private int[] mColour; + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; private static void map(int aId, GTPP_CombType aType) { GTPP_Bees.sCombMappings.put(aId, aType); diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java index cbf448b7f6..6f43d4a43e 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java @@ -13,13 +13,13 @@ public enum GTPP_DropType { FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5)); public boolean mShowInList; - public Material mMaterial; + public final Material mMaterial; public int mChance; - public int mID; + public final int mID; - private String mName; - private String mNameUnlocal; - private int[] mColour; + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; private static void map(int aId, GTPP_DropType aType) { GTPP_Bees.sDropMappings.put(aId, aType); diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java index ec49643001..acca5b810f 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java @@ -12,13 +12,13 @@ public enum GTPP_PollenType { DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)); public boolean mShowInList; - public Material mMaterial; + public final Material mMaterial; public int mChance; - public int mID; + public final int mID; - private String mName; - private String mNameUnlocal; - private int[] mColour; + private final String mName; + private final String mNameUnlocal; + private final int[] mColour; private static void map(int aId, GTPP_PollenType aType) { GTPP_Bees.sPollenMappings.put(aId, aType); diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java index b857827d62..b76d79d387 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java @@ -13,13 +13,13 @@ public enum GTPP_PropolisType { FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20)); public boolean mShowInList; - public Material mMaterial; + public final Material mMaterial; public int mChance; - public int mID; + public final int mID; - private String mName; - private String mNameUnlocal; - private int mColour; + private final String mName; + private final String mNameUnlocal; + private final int mColour; private static void map(int aId, GTPP_PropolisType aType) { GTPP_Bees.sPropolisMappings.put(aId, aType); diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java index 8af5b97b00..ab8771e6db 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java @@ -22,9 +22,6 @@ import gregtech.api.enums.Mods; public class FR_ItemRegistry { // ----- Apiary Frames ---------------------- - // public static FR_ItemHiveFrame frameUntreated; - // public static FR_ItemHiveFrame frameImpregnated; - // public static FR_ItemHiveFrame frameProven; // Magic Bee Frame Items public static MB_ItemFrame hiveFrameAccelerated; diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java index 8ce963fa7a..c63401aecf 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java @@ -11,10 +11,4 @@ public class FR_StringUtil { return StatCollector.translateToFallback(key); } - public static String getLocalizedString(final String key, final Object... objects) { - if (StatCollector.canTranslate(key)) { - return String.format(StatCollector.translateToLocal(key), objects); - } - return String.format(StatCollector.translateToFallback(key), objects); - } } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java index 6fea628473..dcfd524840 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java @@ -146,82 +146,49 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { } } - protected static IAlleleBeeEffect getEffect(byte modid, String name) { - String s; - switch (modid) { - case GTPP_Bees.EXTRABEES: - s = "extrabees.effect." + name; - break; - case GTPP_Bees.GENDUSTRY: - s = "gendustry.effect." + name; - break; - case GTPP_Bees.MAGICBEES: - s = "magicbees.effect" + name; - break; - case GTPP_Bees.GREGTECH: - s = "gregtech.effect" + name; - break; - default: - s = "forestry.effect" + name; - break; - } + private static IAlleleBeeEffect getEffect(byte modid, String name) { + String s = switch (modid) { + case GTPP_Bees.EXTRABEES -> "extrabees.effect." + name; + case GTPP_Bees.GENDUSTRY -> "gendustry.effect." + name; + case GTPP_Bees.MAGICBEES -> "magicbees.effect" + name; + case GTPP_Bees.GREGTECH -> "gregtech.effect" + name; + default -> "forestry.effect" + name; + }; return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s); } - protected static IAlleleFlowers getFlowers(byte modid, String name) { - String s; - switch (modid) { - case GTPP_Bees.EXTRABEES: - s = "extrabees.flower." + name; - break; - case GTPP_Bees.GENDUSTRY: - s = "gendustry.flower." + name; - break; - case GTPP_Bees.MAGICBEES: - s = "magicbees.flower" + name; - break; - case GTPP_Bees.GREGTECH: - s = "gregtech.flower" + name; - break; - default: - s = "forestry.flowers" + name; - break; - } + private static IAlleleFlowers getFlowers(byte modid, String name) { + String s = switch (modid) { + case GTPP_Bees.EXTRABEES -> "extrabees.flower." + name; + case GTPP_Bees.GENDUSTRY -> "gendustry.flower." + name; + case GTPP_Bees.MAGICBEES -> "magicbees.flower" + name; + case GTPP_Bees.GREGTECH -> "gregtech.flower" + name; + default -> "forestry.flowers" + name; + }; return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s); } - protected static IAlleleBeeSpecies getSpecies(byte modid, String name) { - String s; - switch (modid) { - case GTPP_Bees.EXTRABEES: - s = "extrabees.species." + name; - break; - case GTPP_Bees.GENDUSTRY: - s = "gendustry.bee." + name; - break; - case GTPP_Bees.MAGICBEES: - s = "magicbees.species" + name; - break; - case GTPP_Bees.GREGTECH: - s = "gregtech.species" + name; - break; - default: - s = "forestry.species" + name; - break; - } + private static IAlleleBeeSpecies getSpecies(byte modid, String name) { + String s = switch (modid) { + case GTPP_Bees.EXTRABEES -> "extrabees.species." + name; + case GTPP_Bees.GENDUSTRY -> "gendustry.bee." + name; + case GTPP_Bees.MAGICBEES -> "magicbees.species" + name; + case GTPP_Bees.GREGTECH -> "gregtech.species" + name; + default -> "forestry.species" + name; + }; IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s); return ret; } - protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) { + private final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) { this.mSpeciesProperties.accept(species2); } - protected final void setAlleles(IAllele[] template) { + private final void setAlleles(IAllele[] template) { this.mAlleles.accept(template); } - protected final void registerMutations() { + private final void registerMutations() { this.mMutations.accept(this); } @@ -237,27 +204,27 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { BeeManager.beeRoot.registerTemplate(template); } - protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, + private final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) { return registerMutation(parent1, parent2, chance, 1f); } - protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, + private final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) { return registerMutation(parent1, parent2, chance, 1f); } - protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, + private final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance) { return registerMutation(parent1, parent2, chance, 1f); } - protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, + private final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance) { return registerMutation(parent1, parent2, chance, 1f); } - protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) { + private final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) { return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, 1f); } @@ -266,28 +233,27 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { * chancedivider This new function allows Mutation percentages under 1%. Set them as a fraction with chance / * chancedivider */ - protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, - int chance, float chancedivider) { + private final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, + float chancedivider) { return new GTPP_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider); } - protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, - int chance, float chancedivider) { + private final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, + float chancedivider) { return registerMutation(parent1.species, parent2, chance, chancedivider); } - protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, - int chance, float chancedivider) { + private final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance, + float chancedivider) { return registerMutation(parent1, parent2.species, chance, chancedivider); } - protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, + private final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) { return registerMutation(parent1.species, parent2, chance, chancedivider); } - protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance, - float chancedivider) { + private final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance, float chancedivider) { return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, chancedivider); } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java index 69d9319884..77b7d57954 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java @@ -30,11 +30,11 @@ public class GTPP_Bees { public static GTPP_Drop drop; public static GTPP_Comb combs; - public static HashMap sMaterialMappings = new HashMap(); - public static HashMap sPropolisMappings = new HashMap(); - public static HashMap sPollenMappings = new HashMap(); - public static HashMap sDropMappings = new HashMap(); - public static HashMap sCombMappings = new HashMap(); + public static HashMap sMaterialMappings = new HashMap<>(); + public static HashMap sPropolisMappings = new HashMap<>(); + public static HashMap sPollenMappings = new HashMap<>(); + public static HashMap sDropMappings = new HashMap<>(); + public static HashMap sCombMappings = new HashMap<>(); public GTPP_Bees() { if (Forestry.isModLoaded() && GT_Mod.gregtechproxy.mGTBees) { diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java index 4c367e25d4..39af813dec 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java @@ -73,7 +73,7 @@ public enum GTPP_BranchDefinition { return Arrays.copyOf(defaultTemplate, defaultTemplate.length); } - protected final void setBranchProperties(IAllele[] template) { + private final void setBranchProperties(IAllele[] template) { this.mBranchProperties.accept(template); } 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/greg