Beispiel #1
0
 public PacketPlace(int par1, int par2, int par3, int par4, ItemStack par5, float par6, float par7, float par8)
 {
     this.PacketID = 15;
     this.xPosition = par1;
     this.yPosition = par2;
     this.zPosition = par3;
     this.direction = par4;
     this.item = par5;
     this.xOffset = par6;
     this.yOffset = par7;
     this.zOffset = par8;
 }
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.entityID = IPAddress.NetworkToHostOrder(DataInput.ReadInt32());
     this.slot = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.item = readItemStack(DataInput);
 }
Beispiel #3
0
 protected override void readData(System.IO.BinaryReader DataInput)
 {
     this.windowId = DataInput.ReadByte();
     this.itemSlot = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     this.myItemStack = readItemStack(DataInput);
 }
Beispiel #4
0
 protected void writeItemStack(ItemStack item, BinaryWriter DataOutput)
 {
     if (item == null)
     {
         DataOutput.Write(IPAddress.HostToNetworkOrder((short)-1));
     }
     else
     {
         DataOutput.Write(IPAddress.HostToNetworkOrder((short)item.ItemId));
         DataOutput.Write((byte)item.StackSize);
         DataOutput.Write(IPAddress.HostToNetworkOrder((short)item.ItemDamage));
         writeNBTTag(item.NBTdata, DataOutput);
     }
 }
Beispiel #5
0
 protected ItemStack readItemStack(BinaryReader DataInput)
 {
     ItemStack item = new ItemStack();
     short meta = IPAddress.NetworkToHostOrder(DataInput.ReadInt16());
     if (meta >= 0)
     {
         item.StackSize = DataInput.ReadByte();
         item.ItemDamage = DataInput.ReadInt16();
         item.NBTdata = readNBTTag(DataInput);
     }
     else
     {
         return null;
     }
     item.ItemId = meta;
     return item;
 }