diff options
author | Muramasa <haydenkilloh@gmail.com> | 2016-08-14 08:12:25 +0100 |
---|---|---|
committer | Muramasa <haydenkilloh@gmail.com> | 2016-08-14 08:12:25 +0100 |
commit | 5e5fa8cf38d84f2a8542ee5ed1cb998b1e66a5fb (patch) | |
tree | c001e72a7b529d2f903f2ae533e04abb07fe43b3 /src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | |
parent | 7874d1c91fe6c2d39b7623da86224cf2b72439c0 (diff) | |
download | GT5-Unofficial-5e5fa8cf38d84f2a8542ee5ed1cb998b1e66a5fb.tar.gz GT5-Unofficial-5e5fa8cf38d84f2a8542ee5ed1cb998b1e66a5fb.tar.bz2 GT5-Unofficial-5e5fa8cf38d84f2a8542ee5ed1cb998b1e66a5fb.zip |
Revert switch change
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index 5f086895f4..19ac79cf94 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -180,9 +180,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE long tTime = System.currentTimeMillis(); int tCode = 0; - try { - for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { - if (tCode == 0) { + try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) { + switch (tCode) { + case 0: tCode++; if (mTickTimer++ == 0) { oX = xCoord; @@ -196,8 +196,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mMetaTileEntity.onFirstTick(this); if (!hasValidMetaTileEntity()) return; } - } - if (tCode == 1) { + case 1: tCode++; if (isClientSide()) { if (mColor != oColor) { @@ -211,8 +210,12 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mNeedsUpdate = false; } } - } - if (tCode >= 2 && tCode <= 7) { + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: if (isServerSide() && mTickTimer > 10) { for (byte i = (byte) (tCode - 2); i < 6; i++) if (getCoverIDAtSide(i) != 0) { @@ -229,12 +232,11 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mConnections = (byte) ((mConnections & ~64) | -128); } } - } - if (tCode == 8) { + case 8: tCode = 9; mMetaTileEntity.onPreTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) return;} - if (tCode == 9) { + if (!hasValidMetaTileEntity()) return; + case 9: tCode++; if (isServerSide()) { if (mTickTimer == 10) { @@ -251,12 +253,11 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE clearTileEntityBuffer(); } } - } - if (tCode == 10) { + case 10: tCode++; mMetaTileEntity.onPostTick(this, mTickTimer); - if (!hasValidMetaTileEntity()) return;} - if (tCode == 11) { + if (!hasValidMetaTileEntity()) return; + case 11: tCode++; if (isServerSide()) { if (mTickTimer % 10 == 0) { @@ -280,15 +281,13 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mNeedsBlockUpdate = false; } } - } - if (tCode > 11) { + default: tCode = -1; - break; - } } + } } catch (Throwable e) { gregtech.api.util.GT_Log.err.println("Encountered Exception while ticking MetaTileEntity in Step " + (tCode - 1) + ". The Game should've crashed now, but I prevented that. Please report immidietly to GregTech Intergalactical!!!"); - e.printStackTrace(GT_Log.err); + e.printStackTrace(gregtech.api.util.GT_Log.err); } if (isServerSide() && hasValidMetaTileEntity()) { |