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 Packet21PickupSpawn extends Packet {
8
9 public int a;
10 public int b;
11 public int c;
12 public int d;
13 public byte e;
14 public byte f;
15 public byte g;
16 public int h;
17 public int i;
18 public int l;
19
20 public Packet21PickupSpawn() {
21 }
22
23 public Packet21PickupSpawn(EntityItem entityitem) {
24 this.a = entityitem.id;
25 this.h = entityitem.itemStack.id;
26 this.i = entityitem.itemStack.count;
27 this.l = entityitem.itemStack.getData();
28 this.b = MathHelper.floor(entityitem.locX * 32.0D);
29 this.c = MathHelper.floor(entityitem.locY * 32.0D);
30 this.d = MathHelper.floor(entityitem.locZ * 32.0D);
31 this.e = (byte) ((int) (entityitem.motX * 128.0D));
32 this.f = (byte) ((int) (entityitem.motY * 128.0D));
33 this.g = (byte) ((int) (entityitem.motZ * 128.0D));
34 }
35
36 public void a(DataInputStream datainputstream) throws IOException {
37 this.a = datainputstream.readInt();
38 this.h = datainputstream.readShort();
39 this.i = datainputstream.readByte();
40 // uberbukkit
41 if (this.pvn >= 8) {
42 this.l = datainputstream.readShort();
43 } else {
44 this.l = 0;
45 }
46
47 this.b = datainputstream.readInt();
48 this.c = datainputstream.readInt();
49 this.d = datainputstream.readInt();
50 this.e = datainputstream.readByte();
51 this.f = datainputstream.readByte();
52 this.g = datainputstream.readByte();
53 }
54
55 public void a(DataOutputStream dataoutputstream) throws IOException {
56 dataoutputstream.writeInt(this.a);
57 dataoutputstream.writeShort(this.h);
58 dataoutputstream.writeByte(this.i);
59 // uberbukkit
60 if (this.pvn >= 8) {
61 dataoutputstream.writeShort(this.l);
62 }
63
64 dataoutputstream.writeInt(this.b);
65 dataoutputstream.writeInt(this.c);
66 dataoutputstream.writeInt(this.d);
67 dataoutputstream.writeByte(this.e);
68 dataoutputstream.writeByte(this.f);
69 dataoutputstream.writeByte(this.g);
70 }
71
72 public void a(NetHandler nethandler) {
73 nethandler.a(this);
74 }
75
76 public int a() {
77 // uberbukkit
78 return this.pvn >= 8 ? 24 : 22;
79 }
80}