diff options
| author | Connor-Colenso <52056774+Connor-Colenso@users.noreply.github.com> | 2023-10-18 17:03:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-18 18:03:23 +0200 |
| commit | fbdbb388c369fae549cfde3eed38b536f7461d90 (patch) | |
| tree | b46f7fc949d7e4c6e3be910b81ed725e6dc1648e /src/main/java/gtPlusPlus/xmod/gregtech/api | |
| parent | b670446fdf49991093b485f0aa14050039632775 (diff) | |
| download | GT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.tar.gz GT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.tar.bz2 GT5-Unofficial-fbdbb388c369fae549cfde3eed38b536f7461d90.zip | |
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 <colen@CONNORSPC>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api')
19 files changed, 88 insertions, 181 deletions
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<Interface_OreRecipeRegistrator> mOreProcessing = new ArrayList<>(); private final ArrayList<Interface_OreRecipeRegistrator> mOreProcessingFake = new ArrayList<>(); - public ItemStack mContainerItem = null; - public ICondition<ISubTagContainer> mCondition = null; + public final ItemStack mContainerItem = null; + public final ICondition<ISubTagContainer> 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<ItemStack> getInventory() { - ArrayList<ItemStack> aContents = new ArrayList<ItemStack>(); + ArrayList<ItemStack> 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<T extends GT_MetaTileEntity_Ex public boolean causeMaintenanceIssue() { boolean b = false; switch (this.getBaseMetaTileEntity().getRandomNumber(6)) { - case 0: { + case 0 -> { 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<T extends GT_MetaTileEntity_Ex if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { - GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch aHatch) { return mAllDynamoHatches.add(aHatch); } return false; @@ -1072,8 +1065,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex if (aMetaTileEntity == null) { return false; } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch) { - GT_MetaTileEntity_Hatch aHatch = (GT_MetaTileEntity_Hatch) aMetaTileEntity; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch aHatch) { return mAllEnergyHatches.add(aHatch); } return false; @@ -1209,7 +1201,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex tryTickWaitTimerDown(); } - private final void tryTickWaitTimerDown() { + private void tryTickWaitTimerDown() { /* * if (mStartUpCheck > 10) { mStartUpCheck = 10; } */ @@ -1251,7 +1243,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_Ex public static <T> IStructureElement<T> addTieredBlock(Block aBlock, BiPredicate<T, Integer> aSetTheMeta, Function<T, Integer> aGetTheMeta, int minMeta, int maxMeta) { - return new IStructureElement<T>() { + 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<T extends GregtechMeta_SteamMultiBase<T>> extends GregtechMeta_MultiBlockBase<T> { - public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput> mSteamInputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusInput>(); - public ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput> mSteamOutputs = new ArrayList<GT_MetaTileEntity_Hatch_Steam_BusOutput>(); - public ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase> mSteamInputFluids = new ArrayList<GT_MetaTileEntity_Hatch_CustomFluidBase>(); + public ArrayList<GT_MetaTileEntity_Ha |
