aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-07-24 11:55:06 +0200
committerTechnus <daniel112092@gmail.com>2017-07-24 11:55:06 +0200
commit0e3eb6a05a6637bed10d94eeaf8112919d201c1a (patch)
tree5c9681e38ecd63d0e3291bdc59ea93cd79a9620a /src/main/java/com
parentb8d73c63442ff692a9e313eef9a542dca751e36d (diff)
downloadGT5-Unofficial-0e3eb6a05a6637bed10d94eeaf8112919d201c1a.tar.gz
GT5-Unofficial-0e3eb6a05a6637bed10d94eeaf8112919d201c1a.tar.bz2
GT5-Unofficial-0e3eb6a05a6637bed10d94eeaf8112919d201c1a.zip
Refactor microwave pause is now shown and just stops timer, actions, eu use as long as is online
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
index c2b8050aab..e5bf8c54b1 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
@@ -34,6 +34,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
private int powerSetting = 1000;
private int timerSetting = 0;
private int timerValue = 0;
+ private boolean hasBeenPausedThiscycle=false;
//region Structure
//use multi A energy inputs, use less power the longer it runs
@@ -100,6 +101,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public boolean EM_checkRecipe(ItemStack itemStack) {
+ hasBeenPausedThiscycle=false;
if(powerSetting<=300 || eParamsInStatus[0] == PARAM_TOO_HIGH || timerSetting<=0 || timerSetting>3000) return false;
if (timerValue <= 0) {
timerValue=timerSetting;
@@ -113,6 +115,7 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@Override
public void EM_outputFunction() {
+ if(hasBeenPausedThiscycle) return;//skip timer and actions if paused
timerValue--;
IGregTechTileEntity mte=getBaseMetaTileEntity();
int xDirShift = ForgeDirection.getOrientation(mte.getBackFacing()).offsetX*2;
@@ -186,13 +189,12 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
timerSetting = (int)eParamsIn[10];
eParamsOut[0] = timerValue;
+ }
- if (eSafeVoid) {
- eSafeVoid=false;
- int timerValueBackup=timerValue;
- stopMachine();
- timerValue=timerValueBackup;
- }
+ @Override
+ public boolean onRunningTick(ItemStack aStack) {
+ if(eSafeVoid) hasBeenPausedThiscycle=true;
+ return hasBeenPausedThiscycle || super.onRunningTick(aStack);//consume eu and other resources if not paused
}
@Override