Skip to content

Instantly share code, notes, and snippets.

@marvin-roesch
Created December 26, 2013 16:05
Show Gist options
  • Save marvin-roesch/8135451 to your computer and use it in GitHub Desktop.
Save marvin-roesch/8135451 to your computer and use it in GitHub Desktop.
Connection checking example
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, int newId) {
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
if (world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ) instanceof TileCable) {
TileCable tile = (TileCable) world.getBlockTileEntity(x + side.offsetX, y + side.offsetY, z + side.offsetZ);
tile.checkConnections();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment