aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorHoleFish <48403212+HoleFish@users.noreply.github.com>2024-06-08 02:44:03 +0800
committerGitHub <noreply@github.com>2024-06-07 20:44:03 +0200
commitdc976486677197e2df9223067347043a5c22dfa7 (patch)
treecdbec26927b3c43281e20c248a6b3a415ee990c3 /src/main/java/com
parent245beddeb456b296d133211a976fbec449a402c4 (diff)
downloadGT5-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/com')
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_LESU.java18
-rw-r--r--src/main/java/com/github/bartimaeusnek/bartworks/common/tileentities/multis/GT_TileEntity_Windmill.java20
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_EyeOfHarmony.java11
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_ForgeOfGods.java21
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_research.java11
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_transformer.java8
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/base/GT_MetaTileEntity_MultiblockBase_EM.java58
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/godforge_modules/GT_MetaTileEntity_EM_BaseModule.java16
8 files changed, 41 insertions, 122 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;
+ }
}