use of forestry.greenhouse.network.packets.PacketCamouflageSelectionServer in project ForestryMC by ForestryMC.
the class TileGreenhouse method setCamouflageBlock.
/* ICamouflageHandler */
@Override
public boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate) {
if (!ItemStackUtil.isIdenticalItem(camouflageBlock, this.camouflageBlock)) {
this.camouflageBlock = camouflageBlock;
if (sendClientUpdate && world != null && world.isRemote) {
NetworkUtil.sendToServer(new PacketCamouflageSelectionServer(this, CamouflageHandlerType.TILE));
world.markBlockRangeForRenderUpdate(pos, pos);
}
return true;
}
return false;
}
use of forestry.greenhouse.network.packets.PacketCamouflageSelectionServer in project ForestryMC by ForestryMC.
the class GreenhouseController method setCamouflageBlock.
@Override
public boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate) {
if (!ItemStackUtil.isIdenticalItem(camouflageBlock, camouflage)) {
camouflage = camouflageBlock;
if (sendClientUpdate && world.isRemote) {
for (IMultiblockComponent comp : connectedParts) {
if (comp instanceof ICamouflagedTile) {
ICamouflagedTile camBlock = (ICamouflagedTile) comp;
BlockPos coordinates = camBlock.getCoordinates();
world.markBlockRangeForRenderUpdate(coordinates, coordinates);
}
}
NetworkUtil.sendToServer(new PacketCamouflageSelectionServer(this, CamouflageHandlerType.STRUCTURE));
}
return true;
}
return false;
}
use of forestry.greenhouse.network.packets.PacketCamouflageSelectionServer in project ForestryMC by ForestryMC.
the class ItemInventoryCamouflageSprayCan method setCamouflageBlock.
@Override
public boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate) {
if (!ItemStackUtil.isIdenticalItem(camouflageBlock, getStackInSlot(0))) {
setInventorySlotContents(0, camouflageBlock);
World world = player.world;
if (sendClientUpdate && world != null && world.isRemote) {
NetworkUtil.sendToServer(new PacketCamouflageSelectionServer(this, CamouflageHandlerType.ITEM));
}
return true;
}
return false;
}
use of forestry.greenhouse.network.packets.PacketCamouflageSelectionServer in project ForestryMC by ForestryMC.
the class TileClimatiser method setCamouflageBlock.
/* ICamouflageHandler */
@Override
public boolean setCamouflageBlock(ItemStack camouflageBlock, boolean sendClientUpdate) {
if (!ItemStackUtil.isIdenticalItem(camouflageBlock, this.camouflageBlock)) {
this.camouflageBlock = camouflageBlock;
if (sendClientUpdate && world != null && world.isRemote) {
NetworkUtil.sendToServer(new PacketCamouflageSelectionServer(this, CamouflageHandlerType.TILE));
world.markBlockRangeForRenderUpdate(pos, pos);
markDirty();
}
return true;
}
return false;
}
Aggregations