Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 81 lines 2.2 kB view raw
1package net.minecraft.server; 2 3import java.io.DataInputStream; 4import java.io.DataOutputStream; 5import java.io.IOException; 6 7public class Packet102WindowClick extends Packet { 8 9 public int a; 10 public int b; 11 public int c; 12 public short d; 13 public ItemStack e; 14 public boolean f; 15 16 public Packet102WindowClick() { 17 } 18 19 public void a(NetHandler nethandler) { 20 nethandler.a(this); 21 } 22 23 public void a(DataInputStream datainputstream) throws IOException { 24 this.a = datainputstream.readByte(); 25 this.b = datainputstream.readShort(); 26 this.c = datainputstream.readByte(); 27 this.d = datainputstream.readShort(); 28 // uberbukkit 29 if (this.pvn >= 11) { 30 this.f = datainputstream.readBoolean(); 31 } else { 32 this.f = false; 33 } 34 35 short short1 = datainputstream.readShort(); 36 37 if (short1 >= 0) { 38 byte b0 = datainputstream.readByte(); 39 short short2 = 0; 40 // uberbukkit 41 if (this.pvn >= 8) { 42 short2 = datainputstream.readShort(); 43 } else { 44 short2 = datainputstream.readByte(); 45 } 46 47 this.e = new ItemStack(short1, b0, short2); 48 } else { 49 this.e = null; 50 } 51 } 52 53 public void a(DataOutputStream dataoutputstream) throws IOException { 54 dataoutputstream.writeByte(this.a); 55 dataoutputstream.writeShort(this.b); 56 dataoutputstream.writeByte(this.c); 57 dataoutputstream.writeShort(this.d); 58 // uberbukkit 59 if (this.pvn >= 11) { 60 dataoutputstream.writeBoolean(this.f); 61 } 62 63 if (this.e == null) { 64 dataoutputstream.writeShort(-1); 65 } else { 66 dataoutputstream.writeShort(this.e.id); 67 dataoutputstream.writeByte(this.e.count); 68 // uberbukkit 69 if (this.pvn >= 8) { 70 dataoutputstream.writeShort(this.e.getData()); 71 } else { 72 dataoutputstream.writeByte(this.e.getData()); 73 } 74 } 75 } 76 77 public int a() { 78 // uberbukkit 79 return this.pvn >= 8 ? 11 : 10; 80 } 81}