use of mcjty.xnet.multiblock.ColorId in project XNet by McJty.
the class RouterBlock method onBlockPlacedBy.
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(world, pos, state, placer, stack);
if (!world.isRemote) {
XNetBlobData blobData = XNetBlobData.getBlobData(world);
WorldBlob worldBlob = blobData.getWorldBlob(world);
NetworkId networkId = worldBlob.newNetwork();
worldBlob.createNetworkProvider(pos, new ColorId(CableColor.ROUTING.ordinal() + 1), networkId);
blobData.save(world);
}
}
use of mcjty.xnet.multiblock.ColorId in project XNet by McJty.
the class ConnectorBlock method createCableSegment.
public void createCableSegment(World world, BlockPos pos, ConsumerId consumer) {
XNetBlobData blobData = XNetBlobData.getBlobData(world);
WorldBlob worldBlob = blobData.getWorldBlob(world);
CableColor color = world.getBlockState(pos).getValue(COLOR);
worldBlob.createNetworkConsumer(pos, new ColorId(color.ordinal() + 1), consumer);
blobData.save(world);
}
Aggregations