diff options
author | Jason Mitchell <mitchej@gmail.com> | 2018-09-03 18:21:40 -0700 |
---|---|---|
committer | Jason Mitchell <mitchej@gmail.com> | 2018-09-03 18:21:40 -0700 |
commit | fad72d1c68001be4cac656309a18436dadb862bb (patch) | |
tree | cd6f72152a7af9caa2faec6b6d9497a1b12a5450 /src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | |
parent | 1698e57f729efb52e2b98e865a9671f0b50a5b2e (diff) | |
download | GT5-Unofficial-fad72d1c68001be4cac656309a18436dadb862bb.tar.gz GT5-Unofficial-fad72d1c68001be4cac656309a18436dadb862bb.tar.bz2 GT5-Unofficial-fad72d1c68001be4cac656309a18436dadb862bb.zip |
* Fix: Colored cables/pipes properly connect (or don't) to each other based on color
* Trigger connection evaluation on painting of cables/pipes or machines
* Trigger connection evaluation on placement of blocks -- IE: A wire/pipe open to air, and then a dirt block is placed on it - this will close the pipe/wire connection
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index c58db1c81a..2a86b2bbf0 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -50,6 +50,7 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE private byte[] mSidedRedstone = new byte[]{0, 0, 0, 0, 0, 0};
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];
private boolean mInventoryChanged = false, mWorkUpdate = false, mWorks = true, mNeedsUpdate = true, mNeedsBlockUpdate = true, mSendClientData = false;
+ private boolean mCheckConnections = false;
private byte mColor = 0, oColor = 0, mStrongRedstone = 0, oRedstoneData = 63, oTextureData = 0, oUpdateData = 0, mLagWarningCount = 0;
private int oX = 0, oY = 0, oZ = 0, mTimeStatisticsIndex = 0;
private short mID = 0;
@@ -1294,8 +1295,9 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE @Override
public byte setColorization(byte aColor) {
if (aColor > 15 || aColor < -1) aColor = -1;
+ mColor = (byte) (aColor + 1);
if (canAccessData()) mMetaTileEntity.onColorChangeServer(aColor);
- return mColor = (byte) (aColor + 1);
+ return mColor;
}
@Override
@@ -1353,6 +1355,18 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE mInventoryChanged = true;
}
+ public void onNeighborBlockChange(int aX, int aY, int aZ) {
+ if (canAccessData()) {
+ final IMetaTileEntity meta = getMetaTileEntity();
+ if (meta instanceof MetaPipeEntity) {
+ // Trigger a checking of connections in case someone placed down a block that the pipe/wire shouldn't be connected to.
+ // However; don't do it immediately in case the world isn't finished loading
+ // (This caused issues with AE2 GTEU p2p connections.
+ ((MetaPipeEntity) meta).setCheckConnections();
+ }
+ }
+ }
+
@Override
public int getLightOpacity() {
return mMetaTileEntity == null ? 0 : mMetaTileEntity.getLightOpacity();
|