aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common
diff options
context:
space:
mode:
authorcharles <johnch18@isu.edu>2021-03-30 11:20:20 -0600
committercharles <johnch18@isu.edu>2021-03-30 11:20:20 -0600
commit1dfd9dbd3498f1013f8ff84949c3b714021c90d4 (patch)
tree3944e2c6665a8ee220fd7fa6b6a88e7e2571fb1b /src/main/java/gregtech/common
parent5bb2ed3deb2f95765fc2467da5ba98e651e8e44c (diff)
downloadGT5-Unofficial-1dfd9dbd3498f1013f8ff84949c3b714021c90d4.tar.gz
GT5-Unofficial-1dfd9dbd3498f1013f8ff84949c3b714021c90d4.tar.bz2
GT5-Unofficial-1dfd9dbd3498f1013f8ff84949c3b714021c90d4.zip
Made it so that machine control covers disable themselves when the
machine runs out of energy
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
index 487d457b39..d8f2c19c37 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
@@ -16,11 +16,16 @@ import net.minecraftforge.fluids.Fluid;
public class GT_Cover_ControlsWork extends GT_CoverBehavior {
public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) {
if (aTileEntity instanceof IMachineProgress) {
- if ((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2)
- ((IMachineProgress) aTileEntity).enableWorking();
- else
+ if (!((IMachineProgress) aTileEntity).wasShutdown()) {
+ if ((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2)
+ ((IMachineProgress) aTileEntity).enableWorking();
+ else
+ ((IMachineProgress) aTileEntity).disableWorking();
+ ((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone);
+ } else {
((IMachineProgress) aTileEntity).disableWorking();
- ((IMachineProgress) aTileEntity).setWorkDataValue(aInputRedstone);
+ return 2;
+ }
}
return aCoverVariable;
}