aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
diff options
context:
space:
mode:
authorMuramasa <haydenkilloh@gmail.com>2016-09-16 00:17:08 +0100
committerMuramasa <haydenkilloh@gmail.com>2016-09-16 00:17:08 +0100
commit6ac01a92c9b9c54c2c853c6c46bd8e6c8030a4b2 (patch)
tree5f0b682f5b1db4995f9324f8e0094989a9942153 /src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
parentb22bb2dfa6ec7d1e91d8657fcb8bd0389ff7e74a (diff)
downloadGT5-Unofficial-6ac01a92c9b9c54c2c853c6c46bd8e6c8030a4b2.tar.gz
GT5-Unofficial-6ac01a92c9b9c54c2c853c6c46bd8e6c8030a4b2.tar.bz2
GT5-Unofficial-6ac01a92c9b9c54c2c853c6c46bd8e6c8030a4b2.zip
Fix conflicts
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java')
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index bc18ff6909..e2a23e4b41 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -249,8 +249,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
mRunningThroughTick = true;
long tTime = System.currentTimeMillis();
int tCode = 0;
- boolean sidetypeS = isServerSide() ? true : false;
- boolean sidetypeC = isClientSide() ? true : false;
+ boolean aSideServer = isServerSide();
+ boolean aSideClient = isClientSide();
try { for (tCode = 0; hasValidMetaTileEntity() && tCode >= 0; ) {
switch (tCode) {
@@ -260,7 +260,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
oX = xCoord;
oY = yCoord;
oZ = zCoord;
- if (sidetypeS) for (byte i = 0; i < 6; i++)
+ if (aSideServer) for (byte i = 0; i < 6; i++)
if (getCoverIDAtSide(i) != 0)
if (!mMetaTileEntity.allowCoverOnSide(i, new GT_ItemStack(getCoverIDAtSide(i))))
dropCover(i, i, true);
@@ -273,7 +273,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 1:
tCode++;
- if (isClientSide()) {
+ if (aSideClient) {
if (mColor != oColor) {
mMetaTileEntity.onColorChangeClient(oColor = mColor);
issueTextureUpdate();
@@ -304,7 +304,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
case 5:
case 6:
case 7:
- if (sidetypeS && mTickTimer > 10) {
+ if (aSideServer && mTickTimer > 10) {
for (byte i = (byte) (tCode - 2); i < 6; i++)
if (getCoverIDAtSide(i) != 0) {
tCode++;
@@ -322,7 +322,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 8:
tCode = 9;
- if (sidetypeS) {
+ if (aSideServer) {
if (++mAverageEUInputIndex >= mAverageEUInput.length) mAverageEUInputIndex = 0;
if (++mAverageEUOutputIndex >= mAverageEUOutput.length) mAverageEUOutputIndex = 0;
@@ -338,7 +338,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 10:
tCode++;
- if (sidetypeS) {
+ if (aSideServer) {
if (mRedstone != oRedstone || mTickTimer == 10) {
for (byte i = 0; i < 6; i++)
mCoverBehaviors[i] = GregTech_API.getCoverBehavior(mCoverSides[i]);
@@ -435,7 +435,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 11:
tCode++;
- if (sidetypeS) {
+ if (aSideServer) {
if (mMetaTileEntity.dechargerSlotCount() > 0 && getStoredEU() < getEUCapacity()) {
for (int i = mMetaTileEntity.dechargerSlotStartIndex(), k = mMetaTileEntity.dechargerSlotCount() + i; i < k; i++) {
if (mMetaTileEntity.mInventory[i] != null && getStoredEU() < getEUCapacity()) {
@@ -449,7 +449,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 12:
tCode++;
- if (sidetypeS) {
+ if (aSideServer) {
if (mMetaTileEntity.rechargerSlotCount() > 0 && getStoredEU() > 0) {
for (int i = mMetaTileEntity.rechargerSlotStartIndex(), k = mMetaTileEntity.rechargerSlotCount() + i; i < k; i++) {
if (getStoredEU() > 0 && mMetaTileEntity.mInventory[i] != null) {
@@ -477,7 +477,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
case 15:
tCode++;
- if (sidetypeS) {
+ if (aSideServer) {
if (mTickTimer % 10 == 0) {
if (mSendClientData) {
NW.sendPacketToAllPlayersInRange(worldObj, new GT_Packet_TileEntity(xCoord, (short) yCoord, zCoord, mID, mCoverSides[0], mCoverSides[1], mCoverSides[2], mCoverSides[3], mCoverSides[4], mCoverSides[5], oTextureData = (byte) ((mFacing & 7) | (mActive ? 8 : 0) | (mRedstone ? 16 : 0) | (mLockUpgrade ? 32 : 0)), oUpdateData = hasValidMetaTileEntity() ? mMetaTileEntity.getUpdateData() : 0, oRedstoneData = (byte) (((mSidedRedstone[0] > 0) ? 1 : 0) | ((mSidedRedstone[1] > 0) ? 2 : 0) | ((mSidedRedstone[2] > 0) ? 4 : 0) | ((mSidedRedstone[3] > 0) ? 8 : 0) | ((mSidedRedstone[4] > 0) ? 16 : 0) | ((mSidedRedstone[5] > 0) ? 32 : 0)), oColor = mColor), xCoord, zCoord);
@@ -517,11 +517,11 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
}
}
} 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(gregtech.api.util.GT_Log.err);
+ //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);
}
- if (sidetypeS && hasValidMetaTileEntity()) {
+ if (aSideServer && hasValidMetaTileEntity()) {
tTime = System.currentTimeMillis() - tTime;
if (mTimeStatistics.length > 0)
mTimeStatistics[mTimeStatisticsIndex = (mTimeStatisticsIndex + 1) % mTimeStatistics.length] = (int) tTime;
@@ -580,7 +580,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
mFacing = (byte) (aValue & 7);
mActive = ((aValue & 8) != 0);
mRedstone = ((aValue & 16) != 0);
- //mLockUpgrade = ((aValue&32) != 0);
+ //mLockUpgrade = ((aValue&32) != 0);
break;
case 1:
if (hasValidMetaTileEntity()) mMetaTileEntity.onValueUpdate((byte) aValue);
@@ -589,7 +589,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
if (aValue > 16 || aValue < 0) aValue = 0;
mColor = (byte) aValue;
break;
- case 3: //int X & Y = 0 or Y; Y -> {1,2,4,8,16,32}; byte type analogy
+ case 3:
mSidedRedstone[0] = (byte) ((aValue & 1) == 1 ? 15 : 0);
mSidedRedstone[1] = (byte) ((aValue & 2) == 2 ? 15 : 0);
mSidedRedstone[2] = (byte) ((aValue & 4) == 4 ? 15 : 0);
@@ -1095,10 +1095,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
try {
mReleaseEnergy = true;
IEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this);
- } catch (Exception e) {
- /* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */
- GT_Log.out.println("mReleaseEnergy = true;\nIEnergyConnected.Util.emitEnergyToNetwork(V[5], Math.max(1, getStoredEU() / V[5]), this);");
- }
+ } catch (Exception e) {/* Fun Fact: all these "do nothing" Comments you see in my Code, are just there to let Eclipse shut up about the intended empty Brackets, but I need eclipse to yell at me in some of the regular Cases where I forget to add Code */}
}
mReleaseEnergy = false;
// Normal Explosion Code