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