diff options
author | miozune <miozune@gmail.com> | 2023-02-05 01:40:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 17:40:43 +0100 |
commit | bb9da48b9975cb27e3b7c538bff2853a34b36fcd (patch) | |
tree | 9de91abf611bf119935df6322e27805cf835fafc /src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines | |
parent | 8792eb5d9b70cbb1dc0b444cfd8524dfb4a0aa0c (diff) | |
download | GT5-Unofficial-bb9da48b9975cb27e3b7c538bff2853a34b36fcd.tar.gz GT5-Unofficial-bb9da48b9975cb27e3b7c538bff2853a34b36fcd.tar.bz2 GT5-Unofficial-bb9da48b9975cb27e3b7c538bff2853a34b36fcd.zip |
Remove redundant flags (#529)
* Remove CORE.GTNH
* Remove LoadedMods.Gregtech
* Remove LoadedMods.IndustrialCraft2
* Remove LoadedMods.MiscUtils
* Remove CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK
* clean
* Remove mention to GT versions
* Fix assembler mode
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines')
4 files changed, 28 insertions, 94 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java index 9818e0fc52..de4d8f1890 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaGarbageCollector.java @@ -376,7 +376,7 @@ public class GregtechMetaGarbageCollector extends GregtechMetaTileEntity { mLocalTickVar = System.currentTimeMillis(); long aDiff = mLocalTickVar - this.mLastCleanup; if (Utils.getSecondsFromMillis(aDiff) >= (this.mFrequency * 60)) { - CORE.gc(); + System.gc(); this.mLastCleanup = mLocalTickVar; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java index fc6dfb6482..e0d35ff7d2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java @@ -27,7 +27,6 @@ import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -55,18 +54,10 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl @Override public String[] getDescription() { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return new String[] { "Iron is a much better furnace material!", "Can be Automated", - "Multiblock: 3x3x5 hollow with opening on top", - "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.", - "40 Iron Plated Bricks required", }; - } else { - return new String[] { "Sloooowly, Skip the Bronze age, Get some Steel!", - "Multiblock: 3x3x5 hollow with opening on top", "40 Iron Plated Bricks required", "----", - "Even though Iron melts hotter than bronze,", "this machine is to help players skip looking", - "for tin and copper, which are not as common", - "as Iron is. This machine takes 5x longer than the bronze", "blast furnace as a result.", "----", }; - } + return new String[] { "Iron is a much better furnace material!", "Can be Automated", + "Multiblock: 3x3x5 hollow with opening on top", + "Same shape as Bronze/Bricked blast furnace, except one ring of 8 taller.", + "40 Iron Plated Bricks required", }; } @Override @@ -345,11 +336,7 @@ public class GregtechMetaTileEntity_IronBlastFurnace extends MetaTileEntity impl } private int getProperTime(int time) { - if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - return (int) (time / 3); - } else { - return time; - } + return time / 3; } private boolean checkRecipe() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index 3a4f2b81a5..9242389d50 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -6,7 +6,6 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose import static gregtech.api.enums.GT_HatchElement.*; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import java.lang.reflect.Field; import java.util.ArrayList; import net.minecraft.entity.player.EntityPlayer; @@ -35,7 +34,6 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.helpers.CraftingHelper; import gtPlusPlus.xmod.gregtech.common.helpers.autocrafter.AC_Helper_Utils; @@ -52,12 +50,11 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity /** The crafting matrix inventory (3x3). */ public CraftingHelper mInventoryCrafter; - public static enum MODE { + public enum MODE { - CRAFTING("CIRCUIT", "ASSEMBLY"), + CRAFTING("DISASSEMBLY", "ASSEMBLY"), ASSEMBLY("CRAFTING", "DISASSEMBLY"), - DISASSEMBLY("ASSEMBLY", "CIRCUIT"), - CIRCUIT("DISASSEMBLY", "CRAFTING"); + DISASSEMBLY("ASSEMBLY", "CRAFTING"); private final String lastMode; private final String nextMode; @@ -88,9 +85,7 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity @Override public String getMachineType() { - String sType = "Assembler, Disassembler, " - + ((CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK && !CORE.GTNH) ? "Circuit Assembler" : ""); - return sType; + return "Assembler, Disassembler"; } @Override @@ -208,78 +203,32 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity public GT_Recipe.GT_Recipe_Map getRecipeMap() { if (this.mMachineMode == MODE.ASSEMBLY) { return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; - } else if (this.mMachineMode == MODE.CIRCUIT && !CORE.GTNH) { - if (fCircuitMap != null) { - return fCircuitMap; - } - GT_Recipe_Map r; - try { - Field f = ReflectionUtils.getField(GT_Recipe.GT_Recipe_Map.class, "sCircuitAssemblerRecipes"); - if (f != null) { - r = (GT_Recipe_Map) f.get(null); - if (r != null) { - fCircuitMap = r; - return r; - } - } - } catch (IllegalArgumentException | IllegalAccessException e) {} } else if (this.mMachineMode == MODE.DISASSEMBLY || this.mMachineMode == MODE.CRAFTING) { return null; } return GT_Recipe.GT_Recipe_Map.sAssemblerRecipes; } - private boolean isModernGT = true; - @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (isModernGT && !CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - isModernGT = false; - } - // 5.09 support - if (isModernGT && !CORE.GTNH) { + if (mMachineMode.nextMode() == MODE.CRAFTING) { + mMachineMode = MODE.ASSEMBLY; + } else { mMachineMode = mMachineMode.nextMode(); - if (mMachineMode == MODE.CRAFTING) { - PlayerUtils.messagePlayer( - aPlayer, - "Running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting"); - } else if (mMachineMode == MODE.ASSEMBLY) { - PlayerUtils.messagePlayer( - aPlayer, - "Running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly"); - } else if (mMachineMode == MODE.DISASSEMBLY) { - PlayerUtils.messagePlayer( - aPlayer, - "Running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly"); - } else { - PlayerUtils.messagePlayer( - aPlayer, - "Running the Auto-Crafter in mode: " + EnumChatFormatting.YELLOW + "Circuit Assembly"); - } } - // 5.08 support - else { - if (mMachineMode.nextMode() == MODE.CIRCUIT) { - mMachineMode = MODE.ASSEMBLY; - } else if (mMachineMode.nextMode() == MODE.CRAFTING) { - mMachineMode = MODE.ASSEMBLY; - } else { - mMachineMode = mMachineMode.nextMode(); - } - if (mMachineMode == MODE.CRAFTING) { - PlayerUtils.messagePlayer( - aPlayer, - "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting"); - } else if (mMachineMode == MODE.ASSEMBLY) { - PlayerUtils.messagePlayer( - aPlayer, - "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly"); - } else { - PlayerUtils.messagePlayer( - aPlayer, - "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly"); - } + if (mMachineMode == MODE.CRAFTING) { + PlayerUtils.messagePlayer( + aPlayer, + "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.AQUA + "AutoCrafting"); + } else if (mMachineMode == MODE.ASSEMBLY) { + PlayerUtils.messagePlayer( + aPlayer, + "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.GREEN + "Assembly"); + } else { + PlayerUtils.messagePlayer( + aPlayer, + "You are now running the Auto-Crafter in mode: " + EnumChatFormatting.RED + "Disassembly"); } } @@ -484,8 +433,8 @@ public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity if (mMachineMode == MODE.DISASSEMBLY) { tMode = "§cDisassembly"; tSpecialText = "" + (60 + 12 * this.mTier) + "% chance to recover disassembled parts."; - } else if (mMachineMode == MODE.ASSEMBLY || mMachineMode == MODE.CIRCUIT) { - tMode = mMachineMode == MODE.ASSEMBLY ? "§aAssembly" : "§eCircuit Assembly"; + } else if (mMachineMode == MODE.ASSEMBLY) { + tMode = "§aAssembly"; if (mLastRecipeToBuffer != null && mLastRecipeToBuffer.mOutputs[0].getDisplayName() != null) { tSpecialText = "Currently processing: " + mLastRecipeToBuffer.mOutputs[0].getDisplayName(); } else { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java index 2c40e6875a..6543720022 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/bedrock/GregtechMetaTileEntity_BedrockMiningPlatformBase.java @@ -474,9 +474,7 @@ public abstract class GregtechMetaTileEntity_BedrockMiningPlatformBase extends G if (LoadedMods.Railcraft || OreDictUtils.containsValidEntries("oreSaltpeter")) { mMixedOreData.put(new Pair<String, Integer>("oreSaltpeter", 10)); } - if (LoadedMods.IndustrialCraft2 || OreDictUtils.containsValidEntries("oreUranium")) { - mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10)); - } + mMixedOreData.put(new Pair<String, Integer>("oreUranium", 10)); if (OreDictUtils.containsValidEntries("oreSulfur")) { mMixedOreData.put(new Pair<String, Integer>("oreSulfur", 15)); } |