use of mcmultipart.api.world.IMultipartWorld in project Charset by CharsetMC.
the class BlockWire method requestNeighborUpdate.
public void requestNeighborUpdate(World world, BlockPos pos, WireFace location, int connectionMask) {
if ((connectionMask & 0xFF) != 0 && world instanceof IMultipartWorld) {
IPartInfo info = ((IMultipartWorld) world).getPartInfo();
info.getContainer().notifyChange(info);
}
for (EnumFacing facing : EnumFacing.VALUES) {
if (world.isRemote) {
if ((connectionMask & (1 << (facing.ordinal() + 8))) != 0) {
WireUtils.getAllWires(world, pos.offset(facing)).forEach((wire) -> wire.onChanged(true));
} else if (location != WireFace.CENTER && location.facing.getAxis() != facing.getAxis()) {
WireUtils.getAllWires(world, pos.offset(facing).offset(location.facing)).forEach((wire) -> wire.onChanged(true));
}
} else {
if ((connectionMask & (1 << (facing.ordinal() + 8))) != 0) {
world.neighborChanged(pos.offset(facing), this, pos);
} else if (location != WireFace.CENTER && location.facing.getAxis() != facing.getAxis()) {
world.neighborChanged(pos.offset(facing).offset(location.facing), this, pos);
}
}
}
}
Aggregations