Paper/src/main/java/net/minecraft/server/Packet2Handshake.java

47 lines
1.2 KiB
Java
Raw Normal View History

2012-07-29 09:33:13 +02:00
package net.minecraft.server;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException; // CraftBukkit
public class Packet2Handshake extends Packet {
private int a;
private String b;
public String c; // CraftBukkit private -> public
public int d; // CraftBukkit private -> public
2012-07-29 09:33:13 +02:00
public Packet2Handshake() {}
public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit - throws IOException
this.a = datainputstream.readByte();
this.b = a(datainputstream, 16);
this.c = a(datainputstream, 255);
this.d = datainputstream.readInt();
}
public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException
dataoutputstream.writeByte(this.a);
a(this.b, dataoutputstream);
a(this.c, dataoutputstream);
dataoutputstream.writeInt(this.d);
}
public void handle(NetHandler nethandler) {
nethandler.a(this);
}
public int a() {
return 3 + 2 * this.b.length();
}
public int d() {
return this.a;
}
public String f() {
return this.b;
}
}