use of net.geforcemods.securitycraft.network.packets.PacketSSetOwner in project SecurityCraft by Geforce132.
the class EntitySecurityCamera method emitLight.
public void emitLight() {
Block block = this.worldObj.getBlock((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ));
if (block instanceof BlockSecurityCamera) {
this.toggleLightCooldown = 30;
int meta = this.worldObj.getBlockMetadata((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ));
ItemStack[] modules = null;
if (!((CustomizableSCTE) this.worldObj.getTileEntity((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ))).getModules().isEmpty()) {
modules = ((CustomizableSCTE) this.worldObj.getTileEntity((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ))).itemStacks;
}
if (block == mod_SecurityCraft.securityCamera) {
mod_SecurityCraft.network.sendToServer(new PacketSetBlockAndMetadata((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ), "securitycraft:securityCameraLit", meta));
mod_SecurityCraft.network.sendToServer(new PacketSSetOwner((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ), ((IOwnable) this.worldObj.getTileEntity((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ))).getOwner().getUUID(), ((IOwnable) this.worldObj.getTileEntity((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ))).getOwner().getName()));
if (modules != null) {
mod_SecurityCraft.network.sendToServer(new PacketSAddModules((int) Math.floor(this.posX), (int) (this.posY - 1.0D), (int) Math.floor(this.posZ), modules));
}
}
}
}
Aggregations