#2673 Issues with conduits on chunk borders

This is a somewhat experimental change, needs further testing
This commit is contained in:
tterrag1098 committed 2015-08-01 23:17:37 -04:00
1 parent aade399bf5
commit f6d2de4c43
2 files changed
+11 -9

No files matched your search

@@ -432,12 +432,14 @@ public abstract class AbstractConduit implements IConduit {
}
protected void updateNetwork(World world) {
if(getNetwork() == null) {
BlockCoord pos = getLocation();
if(getNetwork() == null && world.blockExists(pos.x, pos.y, pos.z)) {
ConduitUtil.ensureValidNetwork(this);
if(getNetwork() != null && !world.isRemote && bundle != null) {
world.notifyBlocksOfNeighborChange(bundle.getEntity().xCoord, bundle.getEntity().yCoord, bundle.getEntity().zCoord,
bundle.getEntity().getBlockType());
}
// TODO figure out if removing this causes anything horrible to happen. Initial testing shows no difference.
// if(getNetwork() != null && !world.isRemote && bundle != null) {
// world.notifyBlocksOfNeighborChange(bundle.getEntity().xCoord, bundle.getEntity().yCoord, bundle.getEntity().zCoord,
// bundle.getEntity().getBlockType());
// }
}
}
@@ -279,8 +279,8 @@ public class ConduitUtil {
return equipped.getItem() == EnderIO.itemConduitProbe;
}
public static <T extends IConduit> T getConduit(IBlockAccess world, int x, int y, int z, Class<T> type) {
if(world == null) {
public static <T extends IConduit> T getConduit(World world, int x, int y, int z, Class<T> type) {
if(world == null || !world.blockExists(x, y, z)) {
return null;
}
TileEntity te = world.getTileEntity(x, y, z);
@@ -291,11 +291,11 @@ public class ConduitUtil {
return null;
}
public static <T extends IConduit> T getConduit(IBlockAccess world, TileEntity te, ForgeDirection dir, Class<T> type) {
public static <T extends IConduit> T getConduit(World world, TileEntity te, ForgeDirection dir, Class<T> type) {
return ConduitUtil.getConduit(world, te.xCoord + dir.offsetX, te.yCoord + dir.offsetY, te.zCoord + dir.offsetZ, type);
}
public static <T extends IConduit> Collection<T> getConnectedConduits(IBlockAccess world, int x, int y, int z, Class<T> type) {
public static <T extends IConduit> Collection<T> getConnectedConduits(World world, int x, int y, int z, Class<T> type) {
TileEntity te = world.getTileEntity(x, y, z);
if(!(te instanceof IConduitBundle)) {
return Collections.emptyList();