Update all at once

visibileWires
Astoria 1 year ago
parent 68ed0b45f5
commit 51c6168527

@ -41,12 +41,24 @@ public class RedstoneLinkTile extends AbstractWireTile {
if (world.getBlockMetadata(x, y, z) == 0) {
world.setBlockTileEntity(x, y, z, new RedstoneLinkTileEntity());
}
world.notifyBlocksOfNeighborChange(x, y - 1, z, this.blockID);
world.notifyBlocksOfNeighborChange(x, y + 1, z, this.blockID);
world.notifyBlocksOfNeighborChange(x - 1, y, z, this.blockID);
world.notifyBlocksOfNeighborChange(x + 1, y, z, this.blockID);
world.notifyBlocksOfNeighborChange(x, y, z - 1, this.blockID);
world.notifyBlocksOfNeighborChange(x, y, z + 1, this.blockID);
}
@Override
public void onBlockRemoval(World world, int x, int y, int z) {
if (world.getBlockTileEntity(x, y, z) != null && !((RedstoneLinkTileEntity) world.getBlockTileEntity(x, y, z)).shouldnotremove)
super.onBlockRemoval(world, x, y, z);
world.notifyBlocksOfNeighborChange(x, y - 1, z, this.blockID);
world.notifyBlocksOfNeighborChange(x, y + 1, z, this.blockID);
world.notifyBlocksOfNeighborChange(x - 1, y, z, this.blockID);
world.notifyBlocksOfNeighborChange(x + 1, y, z, this.blockID);
world.notifyBlocksOfNeighborChange(x, y, z - 1, this.blockID);
world.notifyBlocksOfNeighborChange(x, y, z + 1, this.blockID);
}
@Override

Loading…
Cancel
Save