Skip to content

Commit

Permalink
Unexpected disconnection Blood-Asp#2
Browse files Browse the repository at this point in the history
  • Loading branch information
Antifluxfield committed Nov 13, 2017
1 parent e9e88db commit 2b8cca2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,26 +276,16 @@ public int connect(byte aSide) {
rConnect = 1;
}
}
}
} else if (getBaseMetaTileEntity().getOffsetX(aSide, 1) >> 4 != getBaseMetaTileEntity().getXCoord() >> 4
|| getBaseMetaTileEntity().getOffsetZ(aSide, 1) >> 4 != getBaseMetaTileEntity().getZCoord() >> 4) { // if chunk unloaded
rConnect = -1;
}
if (rConnect > 0) {
super.connect(aSide);
}
return rConnect;
}

@Override
public void disconnect(byte aSide) {
if (aSide >= 6) return;
mConnections &= ~(1 << aSide);
if (GT_Mod.gregtechproxy.gt6Cable) {
byte tSide = GT_Utility.getOppositeSide(aSide);
IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSide(aSide);
IMetaTileEntity tPipe = tTileEntity == null ? null : tTileEntity.getMetaTileEntity();
if (this.getClass().isInstance(tPipe) && (((MetaPipeEntity) tPipe).mConnections & (1 << tSide)) != 0)
((MetaPipeEntity) tPipe).disconnect(tSide);
}
}

@Override
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ public int connect(byte aSide) {
}
}
}
} else if (getBaseMetaTileEntity().getOffsetX(aSide, 1) >> 4 != getBaseMetaTileEntity().getXCoord() >> 4
|| getBaseMetaTileEntity().getOffsetZ(aSide, 1) >> 4 != getBaseMetaTileEntity().getZCoord() >> 4) { // if chunk unloaded
rConnect = -1;
}
if (rConnect > 0) {
super.connect(aSide);
Expand Down

0 comments on commit 2b8cca2

Please sign in to comment.