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;
6import java.util.HashSet;
7import java.util.Iterator;
8import java.util.Set;
9
10public class Packet60Explosion extends Packet {
11
12 public double a;
13 public double b;
14 public double c;
15 public float d;
16 public Set e;
17
18 public Packet60Explosion() {
19 }
20
21 public Packet60Explosion(double d0, double d1, double d2, float f, Set set) {
22 this.a = d0;
23 this.b = d1;
24 this.c = d2;
25 this.d = f;
26 this.e = new HashSet(set);
27 }
28
29 public void a(DataInputStream datainputstream) throws IOException {
30 this.a = datainputstream.readDouble();
31 this.b = datainputstream.readDouble();
32 this.c = datainputstream.readDouble();
33 this.d = datainputstream.readFloat();
34 int i = datainputstream.readInt();
35
36 this.e = new HashSet();
37 int j = (int) this.a;
38 int k = (int) this.b;
39 int l = (int) this.c;
40
41 for (int i1 = 0; i1 < i; ++i1) {
42 int j1 = datainputstream.readByte() + j;
43 int k1 = datainputstream.readByte() + k;
44 int l1 = datainputstream.readByte() + l;
45
46 this.e.add(new ChunkPosition(j1, k1, l1));
47 }
48 }
49
50 public void a(DataOutputStream dataoutputstream) throws IOException {
51 dataoutputstream.writeDouble(this.a);
52 dataoutputstream.writeDouble(this.b);
53 dataoutputstream.writeDouble(this.c);
54 dataoutputstream.writeFloat(this.d);
55 dataoutputstream.writeInt(this.e.size());
56 int i = (int) this.a;
57 int j = (int) this.b;
58 int k = (int) this.c;
59 Iterator iterator = this.e.iterator();
60
61 while (iterator.hasNext()) {
62 ChunkPosition chunkposition = (ChunkPosition) iterator.next();
63 int l = chunkposition.x - i;
64 int i1 = chunkposition.y - j;
65 int j1 = chunkposition.z - k;
66
67 dataoutputstream.writeByte(l);
68 dataoutputstream.writeByte(i1);
69 dataoutputstream.writeByte(j1);
70 }
71 }
72
73 public void a(NetHandler nethandler) {
74 nethandler.a(this);
75 }
76
77 public int a() {
78 return 32 + this.e.size() * 3;
79 }
80}