public Packet getDescriptionPacket() { NBTTagCompound root = new NBTTagCompound(); NBTTagList nbttaglist = root.getTagList("contents"); for (ItemStack itemStack : contents) { nbttaglist.appendTag(itemStack == null ? new NBTTagCompound() : itemStack.writeToNBT(new NBTTagCompound())); } root.setTag("contents", nbttaglist); root.setString("username", username); root.setCompoundTag("holding", holding == null ? new NBTTagCompound() : holding.writeToNBT(new NBTTagCompound())); root.setString("text", BSConstants.TEXT_JOINER.join(text)); root.setInteger("age", age); return new Packet132TileEntityData(xCoord, yCoord, zCoord, 15, root); }
@Override public void onDataPacket( INetworkManager net, Packet132TileEntityData packet ) { switch( packet.actionType ) { case 0: { this.readFromNBT( packet.data ); worldObj.markBlockForUpdate( xCoord, yCoord, zCoord ); break; } default: { break; } } }
public void func_72468_a(Packet132TileEntityData p_72468_1_) { if(this.field_72563_h.field_71441_e.func_72899_e(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c)) { TileEntity var2 = this.field_72563_h.field_71441_e.func_72796_p(p_72468_1_.field_73334_a, p_72468_1_.field_73332_b, p_72468_1_.field_73333_c); if(var2 != null) { if(p_72468_1_.field_73330_d == 1 && var2 instanceof TileEntityMobSpawner) { var2.func_70307_a(p_72468_1_.field_73331_e); } else if(p_72468_1_.field_73330_d == 2 && var2 instanceof TileEntityCommandBlock) { var2.func_70307_a(p_72468_1_.field_73331_e); } else if(p_72468_1_.field_73330_d == 3 && var2 instanceof TileEntityBeacon) { var2.func_70307_a(p_72468_1_.field_73331_e); } else if(p_72468_1_.field_73330_d == 4 && var2 instanceof TileEntitySkull) { var2.func_70307_a(p_72468_1_.field_73331_e); } } } }
@Override public Packet getDescriptionPacket() { NBTTagCompound dataTag = new NBTTagCompound(); NBTTagList itemList = new NBTTagList(); for (int i = 0; i < this.inventory.length; i++) { ItemStack stack = this.inventory[i]; if (stack != null) { NBTTagCompound tag = new NBTTagCompound(); tag.setByte("Slot", (byte) i); stack.writeToNBT(tag); itemList.appendTag(tag); } } dataTag.setTag("AmitStandInventory", itemList); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, dataTag); }
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { super.onDataPacket(net, packet); readFromNBT(packet.data); NBTTagCompound fluids = packet.data.getCompoundTag("fluids"); fluidsInNetwork = new ArrayList<SpecialFluidStack>(); int[] fluidIDs = fluids.getIntArray("FluidIDs"); for (int i = 0; i < fluidIDs.length; i++) { fluidsInNetwork.add(new SpecialFluidStack(fluidIDs[i], fluids.getLong("FluidAmount#" + i))); } NBTTagCompound craftableFluids = packet.data.getCompoundTag("craftablefluids"); craftableFluidsInNetwork = new ArrayList<Fluid>(); int[] craftableFluidIDs = craftableFluids.getIntArray("FluidIDs"); for (int i = 0; i < craftableFluidIDs.length; i++) { craftableFluidsInNetwork.add(FluidRegistry.getFluid(craftableFluidIDs[i])); } currentFluid = FluidRegistry.getFluid(packet.data.getInteger("currentFluid")); powerStatus = packet.data.getBoolean("powered"); networkReady = packet.data.getBoolean("ready"); worldObj.updateAllLightTypes(xCoord, yCoord, zCoord); }
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { NBTTagList nbttaglist = pkt.data.getTagList("contents"); contents = new ItemStack[nbttaglist.tagCount()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { contents[i] = ItemStack.loadItemStackFromNBT((NBTTagCompound) nbttaglist.tagAt(i)); } username = pkt.data.getString("username"); holding = ItemStack.loadItemStackFromNBT(pkt.data.getCompoundTag("holding")); text = pkt.data.getString("text").split("\n"); age = pkt.data.getInteger("age"); }
/** * Overriden in a sign to provide the text. */ public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); nbttagcompound.removeTag("SpawnPotentials"); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbttagcompound); }
@Override public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT( nbttagcompound ); return new Packet132TileEntityData( this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound ); }
@Override public Packet getDescriptionPacket() { Packet132TileEntityData packet = new Packet132TileEntityData(xCoord, yCoord, zCoord, 5, new NBTTagCompound()); packet.data.setInteger("redstoneMode", redstoneMode); packet.data.setInteger("crafts", crafts); return packet; }
@Override public void onDataPacket(INetworkManager manager, Packet132TileEntityData packet) { switch (packet.actionType) { case DATA_CLIENT: readFromNBT(packet.data); break; case DATA_POKE: onPoke(); break; case DATA_DATA: onData(packet.data); break; } }
public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) { if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition)) { TileEntity tileentity = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition); if (tileentity != null) { if (par1Packet132TileEntityData.actionType == 1 && tileentity instanceof TileEntityMobSpawner) { tileentity.readFromNBT(par1Packet132TileEntityData.data); } else if (par1Packet132TileEntityData.actionType == 2 && tileentity instanceof TileEntityCommandBlock) { tileentity.readFromNBT(par1Packet132TileEntityData.data); } else if (par1Packet132TileEntityData.actionType == 3 && tileentity instanceof TileEntityBeacon) { tileentity.readFromNBT(par1Packet132TileEntityData.data); } else if (par1Packet132TileEntityData.actionType == 4 && tileentity instanceof TileEntitySkull) { tileentity.readFromNBT(par1Packet132TileEntityData.data); } else { tileentity.onDataPacket(netManager, par1Packet132TileEntityData); } } } }
/** * Overriden in a sign to provide the text. */ public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, nbttagcompound); }
/** * Overriden in a sign to provide the text. */ public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, nbttagcompound); }
/** * Overriden in a sign to provide the text. */ public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, nbttagcompound); }
public Packet getDescriptionPacket() { NBTTagCompound nbt = new NBTTagCompound(); if (magitank.getFluid() != null) { nbt.setInteger("Magi", magitank.getFluid().amount); } return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, nbt); }
@Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); this.writeToNBT(tag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 0, tag); }
@Override public Packet getDescriptionPacket() { NBTTagCompound data = new NBTTagCompound(); data.setInteger("rotation", getDirectionFacing().ordinal()); data.setBoolean("working", isWorking()); data.setInteger("tier", getTier()); Packet132TileEntityData packet = new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, data); return packet; }
@Override public Packet getDescriptionPacket() { //sideLog(java.util.logging.Level.INFO, "getDescriptionPacket"); Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); NBTTagCompound tag = packet != null ? packet.customParam1 : new NBTTagCompound(); if (tank.containsValidLiquid()) { //sideLog(java.util.logging.Level.INFO, "Amount: " + ((Integer)tank.getLiquid().amount).toString()); tag.setTag("tank", tank.getLiquid().writeToNBT(new NBTTagCompound())); } return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); }
@Override public Packet getDescriptionPacket() { NBTTagCompound tagCompound = new NBTTagCompound(); writeNBTProgress(tagCompound); writeNBTEnderData(tagCompound); tagCompound.setByte("c", (byte)clientRenderMessage); this.clientRenderMessage = 0; return new Packet132TileEntityData(xCoord, yCoord, zCoord, 0, tagCompound); }
@Override public void onDataPacket(INetworkManager networkManager, Packet132TileEntityData packet) { switch((int)packet.data.getByte("c")) { case 1: this.spawnSuccessParticles(); break; } this.setEnderNetIDClient(packet.data.getInteger("eid")); this.isReceiveable = packet.data.getBoolean("r"); GuiScreen gui = FMLClientHandler.instance().getClient().currentScreen; if (gui != null && gui instanceof GuiEnderTransmitter) { GuiEnderTransmitter get = (GuiEnderTransmitter)gui; get.syncNBTFromClient(packet.data); } }
@Override public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); nbtTag.setInteger("Progress", progress); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); }
@Override public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); }
@Override public Packet getDescriptionPacket() { final NBTTagCompound tag = new NBTTagCompound(); writeCustomNBT(tag); return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); }
/** * Overriden in a sign to provide the text. */ @Override public Packet getDescriptionPacket() { NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new Packet132TileEntityData(xCoord, yCoord, zCoord, 4, nbttagcompound); }
@Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); }