Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 75 lines 1.8 kB view raw
1package net.minecraft.server; 2 3import java.io.DataInputStream; 4import java.io.DataOutputStream; 5import java.io.IOException; 6 7public class Packet130UpdateSign extends Packet { 8 9 public int x; 10 public int y; 11 public int z; 12 public String[] lines; 13 14 public Packet130UpdateSign() { 15 this.k = true; 16 } 17 18 public Packet130UpdateSign(int i, int j, int k, String[] astring) { 19 this.k = true; 20 this.x = i; 21 this.y = j; 22 this.z = k; 23 this.lines = astring; 24 } 25 26 public void a(DataInputStream datainputstream) throws IOException { 27 this.x = datainputstream.readInt(); 28 this.y = datainputstream.readShort(); 29 this.z = datainputstream.readInt(); 30 this.lines = new String[4]; 31 32 for (int i = 0; i < 4; ++i) { 33 // uberbukkit 34 if (this.pvn >= 11) { 35 this.lines[i] = a(datainputstream, 15); 36 } else { 37 this.lines[i] = datainputstream.readUTF(); 38 } 39 } 40 } 41 42 public void a(DataOutputStream dataoutputstream) throws IOException { 43 dataoutputstream.writeInt(this.x); 44 dataoutputstream.writeShort(this.y); 45 dataoutputstream.writeInt(this.z); 46 47 for (int i = 0; i < 4; ++i) { 48 // uberbukkit 49 if (this.pvn >= 11) { 50 a(this.lines[i], dataoutputstream); 51 } else { 52 dataoutputstream.writeUTF(this.lines[i]); 53 } 54 } 55 } 56 57 public void a(NetHandler nethandler) { 58 nethandler.a(this); 59 } 60 61 public int a() { 62 int i = 0; 63 64 for (int j = 0; j < 4; ++j) { 65 i += this.lines[j].length(); 66 } 67 68 return i; 69 } 70 71 @Override 72 public Packet clone() { 73 return new Packet130UpdateSign(this.x, this.y, this.z, this.lines); 74 } 75}