Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-20 13:30:05 +01:00
47 Zeilen
1.1 KiB
Java
47 Zeilen
1.1 KiB
Java
|
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
|
||
|
private int d;
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
}
|