diff options
| author | HoleFish <48403212+HoleFish@users.noreply.github.com> | 2024-06-08 02:44:03 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-07 20:44:03 +0200 |
| commit | dc976486677197e2df9223067347043a5c22dfa7 (patch) | |
| tree | cdbec26927b3c43281e20c248a6b3a415ee990c3 /src/main/java | |
| parent | 245beddeb456b296d133211a976fbec449a402c4 (diff) | |
| download | GT5-Unofficial-dc976486677197e2df9223067347043a5c22dfa7.tar.gz GT5-Unofficial-dc976486677197e2df9223067347043a5c22dfa7.tar.bz2 GT5-Unofficial-dc976486677197e2df9223067347043a5c22dfa7.zip | |
Maintenance cleanup (#2632)
* cleanup
* waila
* fix & compatibility
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java')
26 files changed, 164 insertions, 344 deletions
diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java index 30b656cbf7..e5c6031c8e 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java @@ -338,12 +338,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { if (aBaseMetaTileEntity.isServerSide()) { this.mMaxProgresstime = 1; if (aTick % 20 == 0) this.checkMachine(aBaseMetaTileEntity, null); - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; } } @@ -408,13 +402,6 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { this.mMaxProgresstime = 1; this.mProgresstime = 0; - this.mCrowbar = true; - this.mHardHammer = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mSolderingTool = true; - this.mWrench = true; - this.getBaseMetaTileEntity() .enableWorking(); this.getBaseMetaTileEntity() @@ -595,4 +582,9 @@ public class GT_TileEntity_LESU extends GT_MetaTileEntity_MultiBlockBase { widget -> !this.getBaseMetaTileEntity() .isActive())); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java index a1e1f1fd46..518db00954 100644 --- a/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java +++ b/src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java @@ -389,18 +389,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock this.mDoor = 0; this.mHardenedClay = 0; - if (!this.checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0) || this.tileEntityDispensers.isEmpty() - || this.mDoor > 2 - || this.mHardenedClay < 40) return false; - - this.mWrench = true; - this.mScrewdriver = true; - this.mSoftHammer = true; - this.mHardHammer = true; - this.mSolderingTool = true; - this.mCrowbar = true; - - return true; + return this.checkPiece(STRUCTURE_PIECE_MAIN, 3, 11, 0) && !this.tileEntityDispensers.isEmpty() + && this.mDoor <= 2 + && this.mHardenedClay >= 40; } @Override @@ -638,4 +629,9 @@ public class GT_TileEntity_Windmill extends GT_MetaTileEntity_EnhancedMultiBlock .setPos(92, 22)) .widget(new FakeSyncWidget.BooleanSyncer(() -> this.mMachine, val -> this.mMachine = val)); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java index afa09dd193..24d2173285 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java @@ -919,12 +919,6 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl return false; } - mHardHammer = true; - mSoftHammer = true; - mScrewdriver = true; - mCrowbar = true; - mSolderingTool = true; - mWrench = true; return true; } @@ -1764,4 +1758,9 @@ public class GT_MetaTileEntity_EM_EyeOfHarmony extends GT_MetaTileEntity_Multibl super.loadNBTData(aNBT); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_ForgeOfGods.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_ForgeOfGods.java index 6d6d7fdb43..e8e27e7bfc 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_ForgeOfGods.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_ForgeOfGods.java @@ -312,12 +312,6 @@ public class GT_MetaTileEntity_EM_ForgeOfGods extends GT_MetaTileEntity_Multiblo } } - mHardHammer = true; - mSoftHammer = true; - mScrewdriver = true; - mCrowbar = true; - mSolderingTool = true; - mWrench = true; return true; } @@ -414,7 +408,6 @@ public class GT_MetaTileEntity_EM_ForgeOfGods extends GT_MetaTileEntity_Multiblo } } if (mEfficiency < 0) mEfficiency = 0; - fixAllMaintenance(); } } } @@ -515,15 +508,6 @@ public class GT_MetaTileEntity_EM_ForgeOfGods extends GT_MetaTileEntity_Multiblo super.onRemoval(); } - protected void fixAllMaintenance() { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - } - @Override public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { if (doesBindPlayerInventory()) { @@ -2382,4 +2366,9 @@ public class GT_MetaTileEntity_EM_ForgeOfGods extends GT_MetaTileEntity_Multiblo super.loadNBTData(NBT); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java index fce7913613..baed9c8607 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java @@ -762,11 +762,12 @@ public class GT_MetaTileEntity_EM_research extends GT_MetaTileEntity_MultiblockB if (tag.getBoolean("incompleteStructure")) { currentTip.add(RED + "** INCOMPLETE STRUCTURE **" + RESET); } - currentTip.add( - (tag.getBoolean("hasProblems") ? (RED + "** HAS PROBLEMS **") : GREEN + "Running Fine") + RESET - + " Efficiency: " - + tag.getFloat("efficiency") - + "%"); + String efficiency = RESET + " Efficiency: " + tag.getFloat("efficiency") + "%"; + if (tag.getBoolean("hasProblems")) { + currentTip.add(RED + "** HAS PROBLEMS **" + efficiency); + } else if (!tag.getBoolean("incompleteStructure")) { + currentTip.add(GREEN + "Running Fine" + efficiency); + } currentTip.add("Mode: " + tag.getString("machineType")); currentTip.add( String.format( diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java index d6ab5fa6eb..308482b862 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java @@ -47,7 +47,6 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo @Override public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { - if (!hasMaintenanceChecks) turnOffMaintenance(); if (!mMachine) { aBaseMetaTileEntity.disableWorking(); } @@ -82,13 +81,11 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo public GT_MetaTileEntity_EM_transformer(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - turnOffMaintenance(); eDismantleBoom = true; } public GT_MetaTileEntity_EM_transformer(String aName) { super(aName); - turnOffMaintenance(); eDismantleBoom = true; } @@ -218,4 +215,9 @@ public class GT_MetaTileEntity_EM_transformer extends GT_MetaTileEntity_Multiblo public boolean isAllowedToWorkButtonEnabled() { return true; } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java index 20a9582521..2e89aa7f82 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java @@ -96,7 +96,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maint import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.recipe.check.CheckRecipeResult; import gregtech.api.recipe.check.CheckRecipeResultRegistry; import gregtech.api.util.GT_HatchElementBuilder; @@ -304,7 +303,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM * Checks Recipes (when all machine is complete and can work) * <p> * can get/set Parameters here also - * + * * @deprecated Use {@link #createProcessingLogic()} ()} or {@link #checkProcessing_EM()} * * @param itemStack item in the controller @@ -1121,7 +1120,7 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM if (mMachine) { // S byte Tick = (byte) (aTick % 20); if (MULTI_CHECK_AT == Tick) { - maintenance_EM(); + checkMaintenance(); } if (getRepairStatus() >= minRepairStatus) { // S @@ -1235,49 +1234,6 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM mOutputFluids = null; } - protected void maintenance_EM() { - if (GT_MetaTileEntity_MultiBlockBase.disableMaintenance) { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - } else { - for (GT_MetaTileEntity_Hatch_Maintenance tHatch : filterValidMTEs(mMaintenanceHatches)) { - if (tHatch.mAuto - && !(mWrench && mScrewdriver && mSoftHammer && mHardHammer && mSolderingTool && mCrowbar)) { - tHatch.autoMaintainance(); - } - if (tHatch.mWrench) { - mWrench = true; - } - if (tHatch.mScrewdriver) { - mScrewdriver = true; - } - if (tHatch.mSoftHammer) { - mSoftHammer = true; - } - if (tHatch.mHardHammer) { - mHardHammer = true; - } - if (tHatch.mSolderingTool) { - mSolderingTool = true; - } - if (tHatch.mCrowbar) { - mCrowbar = true; - } - - tHatch.mWrench = false; - tHatch.mScrewdriver = false; - tHatch.mSoftHammer = false; - tHatch.mHardHammer = false; - tHatch.mSolderingTool = false; - tHatch.mCrowbar = false; - } - } - } - protected void clearHatches_EM() { mDualInputHatches.clear(); mInputHatches.clear(); @@ -2810,14 +2766,4 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM } // endregion - - protected void turnOffMaintenance() { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - hasMaintenanceChecks = false; - } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/godforge_modules/GT_MetaTileEntity_EM_BaseModule.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/godforge_modules/GT_MetaTileEntity_EM_BaseModule.java index 004fc2b40a..86e8e97993 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/godforge_modules/GT_MetaTileEntity_EM_BaseModule.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/godforge_modules/GT_MetaTileEntity_EM_BaseModule.java @@ -128,7 +128,6 @@ public class GT_MetaTileEntity_EM_BaseModule extends GT_MetaTileEntity_Multibloc public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide() && isConnected) { super.onPostTick(aBaseMetaTileEntity, aTick); - if (aTick % 400 == 0) fixAllIssues(); if (mEfficiency < 0) mEfficiency = 0; } } @@ -267,15 +266,6 @@ public class GT_MetaTileEntity_EM_BaseModule extends GT_MetaTileEntity_Multibloc recipeTally += amount; } - protected void fixAllIssues() { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - } - public int getTier() { return tier; } @@ -297,7 +287,6 @@ public class GT_MetaTileEntity_EM_BaseModule extends GT_MetaTileEntity_Multibloc @Override public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - fixAllIssues(); return structureCheck_EM(STRUCTURE_PIECE_MAIN, 3, 3, 0); } @@ -494,4 +483,9 @@ public class GT_MetaTileEntity_EM_BaseModule extends GT_MetaTileEntity_Multibloc } return new ITexture[] { Textures.BlockIcons.getCasingTextureForId(TEXTURE_INDEX) }; } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java b/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java index ae3395ffb9..7117ccddf1 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/CoolantTower.java @@ -99,12 +99,6 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM @Override public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; return structureCheck_EM(mName, 5, 11, 0); } @@ -139,19 +133,6 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM } @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - if (aTick % 72000 == 0) { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; - } - } - - @Override public int getMaxEfficiency(ItemStack aStack) { return 10000; } @@ -222,4 +203,9 @@ public class CoolantTower extends GT_MetaTileEntity_TooltipMultiBlockBase_EM if (mMachine) return -1; return survivialBuildPiece(mName, stackSize, 5, 11, 0, elementBudget, env, false, true); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java index 85c4bffbab..8fbe8787ed 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/FuelRefineFactory.java @@ -59,22 +59,15 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E public FuelRefineFactory(String name) { super(name); - turnOffMaintenance(); useLongPower = true; } public FuelRefineFactory(int id, String name, String nameRegional) { super(id, name, nameRegional); - turnOffMaintenance(); useLongPower = true; } @Override - public void onFirstTick_EM(IGregTechTileEntity aBaseMetaTileEntity) { - if (!hasMaintenanceChecks) turnOffMaintenance(); - } - - @Override public boolean doRandomMaintenanceDamage() { return true; } @@ -373,4 +366,9 @@ public class FuelRefineFactory extends GT_MetaTileEntity_TooltipMultiBlockBase_E if (mMachine) return -1; return survivialBuildPiece(mName, stackSize, 7, 12, 1, elementBudget, env, false, true); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java index 039bd76c51..d5572e0b16 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/LargeEssentiaSmeltery.java @@ -538,11 +538,6 @@ public class LargeEssentiaSmeltery extends GT_MetaTileEntity_TooltipMultiBlockBa } @Override - protected void maintenance_EM() { - super.maintenance_EM(); - } - - @Override public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; int built = survivialBuildPiece(STRUCTURE_PIECE_FIRST, stackSize, 2, 2, 0, elementBudget, env, false, true); diff --git a/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java b/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java index f712fa12a7..e162cf9e30 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/YottaFluidTank.java @@ -270,12 +270,6 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM if (mFluid == null) { mStorageCurrent = BigInteger.ZERO; } - mWrench = true; - mScrewdriver = true; - mSolderingTool = true; - mSoftHammer = true; - mHardHammer = true; - mCrowbar = true; return true; } return false; @@ -706,4 +700,9 @@ public class YottaFluidTank extends GT_MetaTileEntity_TooltipMultiBlockBase_EM .addTooltip(StatCollector.translateToLocal("gui.YOTTank.button.locking")) .setTooltipShowUpDelay(TOOLTIP_DELAY); } + + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } } diff --git a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java index 5608d19ae4..dbb6beae8b 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/base/LargeFusionComputer.java @@ -203,22 +203,9 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti @Override public boolean checkMachine_EM(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { this.eEnergyMulti.clear(); - if (structureCheck_EM(MAIN_NAME, 23, 3, 40) && mInputHatches.size() + mDualInputHatches.size() != 0 + return structureCheck_EM(MAIN_NAME, 23, 3, 40) && mInputHatches.size() + mDualInputHatches.size() != 0 && !mOutputHatches.isEmpty() - && (mEnergyHatches.size() + eEnergyMulti.size()) != 0) { - fixAllIssue(); - return true; - } - return false; - } - - public void fixAllIssue() { - mWrench = true; - mScrewdriver = true; - mSoftHammer = true; - mHardHammer = true; - mSolderingTool = true; - mCrowbar = true; + && (mEnergyHatches.size() + eEnergyMulti.size()) != 0; } @Override @@ -275,7 +262,6 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti } if (aBaseMetaTileEntity.isServerSide()) { - if (aTick % 400 == 0) fixAllIssue(); if (mEfficiency < 0) mEfficiency = 0; if (mRunningOnLoad && checkMachine(aBaseMetaTileEntity, mInventory[1])) { checkRecipe(); @@ -631,6 +617,11 @@ public abstract class LargeFusionComputer extends GT_MetaTileEntity_TooltipMulti .widget(new FakeSyncWidget.LongSyncer(this::getEUVar, this::setEUVar)); } + @Override + public boolean getDefaultHasMaintenanceChecks() { + return false; + } + public static final String[] L0 = { " ", " ", " FCCCCCF ", " FCIBICF ", " FCCCCCF ", diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java index 29f24fa685..810f9a123f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java @@ -114,6 +114,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity implements ControllerWithOptionalFeatures, IAddGregtechLogo, IAddUIWidgets, IBindPlayerInventoryUI { public static boolean disableMaintenance; + public boolean hasMaintenanceChecks = getDefaultHasMaintenanceChecks(); public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, mCrowbar = false, mRunningOnLoad = false; public boolean mStructureChanged = false; @@ -168,6 +169,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity this.damageFactorHigh = (float) GregTech_API.sMachineFile .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); this.mNEI = ""; + if (!shouldCheckMaintenance()) fixAllIssues(); } public GT_MetaTileEntity_MultiBlockBase(String aName) { @@ -179,6 +181,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorLow", 5); this.damageFactorHigh = (float) GregTech_API.sMachineFile .get(ConfigCategories.machineconfig, "MultiBlockMachines.damageFactorHigh", 0.6f); + if (!shouldCheckMaintenance()) fixAllIssues(); } @Override @@ -324,13 +327,14 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity for (int i = 0; i < mOutputFluids.length; i++) mOutputFluids[i] = GT_Utility.loadFluid(aNBT, "mOutputFluids" + i); } - - mWrench = aNBT.getBoolean("mWrench"); - mScrewdriver = aNBT.getBoolean("mScrewdriver"); - mSoftHammer = aNBT.getBoolean("mSoftHammer"); - mHardHammer = aNBT.getBoolean("mHardHammer"); - mSolderingTool = aNBT.getBoolean("mSolderingTool"); - mCrowbar = aNBT.getBoolean("mCrowbar"); + if (shouldCheckMaintenance()) { + mWrench = aNBT.getBoolean("mWrench"); + mScrewdriver = aNBT.getBoolean("mScrewdriver"); + mSoftHammer = aNBT.getBoolean("mSoftHammer"); + mHardHammer = aNBT.getBoolean("mHardHammer"); + mSolderingTool = aNBT.getBoolean("mSolderingTool"); + mCrowbar = aNBT.getBoolean("mCrowbar"); + } else fixAllIssues(); } protected SingleRecipeCheck loadSingleRecipeChecker(NBTTagCompound aNBT) { @@ -444,17 +448,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity } } - private void checkMaintenance() { - if (disableMaintenance) { - mWrench = true; - |
