diff options
author | Martin Robertz <dream-master@gmx.net> | 2017-12-19 17:09:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 17:09:33 +0100 |
commit | 1c44725f64bb2fb9cbea1b6a3ef4024999a0301f (patch) | |
tree | 8bb2f668885ad24ceace227b93737cb043553d86 /src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | |
parent | bb8b175d6b27c21a095e13c776c814856c23a3d6 (diff) | |
parent | 73ba61d809115bdedacedba994cea8c75f72c4a9 (diff) | |
download | GT5-Unofficial-1c44725f64bb2fb9cbea1b6a3ef4024999a0301f.tar.gz GT5-Unofficial-1c44725f64bb2fb9cbea1b6a3ef4024999a0301f.tar.bz2 GT5-Unofficial-1c44725f64bb2fb9cbea1b6a3ef4024999a0301f.zip |
Merge pull request #63 from Antifluxfield/GTNH-GT6_cable_fix
Fix cable connection
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index 5e36bb624c..fe92f313a7 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -56,6 +56,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE protected int mAverageEUInputIndex = 0, mAverageEUOutputIndex = 0; protected boolean mReleaseEnergy = false; protected int[] mAverageEUInput = new int[]{0, 0, 0, 0, 0}, mAverageEUOutput = new int[]{0, 0, 0, 0, 0}; + private boolean mEnergyStateReady = false; private boolean[] mActiveEUInputs = new boolean[]{false, false, false, false, false, false}, mActiveEUOutputs = new boolean[]{false, false, false, false, false, false}; private byte[] mSidedRedstone = new byte[]{15, 15, 15, 15, 15, 15}; private int[] mCoverSides = new int[]{0, 0, 0, 0, 0, 0}, mCoverData = new int[]{0, 0, 0, 0, 0, 0}, mTimeStatistics = new int[GregTech_API.TICKS_FOR_LAG_AVERAGING]; @@ -455,6 +456,8 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } } } + // We're ready to tell about our energy state - Only used server side + mEnergyStateReady = true; } if (!hasValidMetaTileEntity()) { @@ -969,6 +972,12 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE } @Override + public boolean energyStateReady() { + if (!isServerSide()) return true; + else return mEnergyStateReady; + } + + @Override public boolean inputEnergyFrom(byte aSide) { if (aSide == 6) return true; if (isServerSide()) return (aSide >= 0 && aSide < 6 ? mActiveEUInputs[aSide] : false) && !mReleaseEnergy; |