summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java')
-rw-r--r--src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java b/src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java
new file mode 100644
index 00000000..5df99a44
--- /dev/null
+++ b/src/main/java/net/minecraft/server/PacketPlayInCustomPayload.java
@@ -0,0 +1,45 @@
+package net.minecraft.server;
+
+import java.io.IOException; // CraftBukkit
+
+public class PacketPlayInCustomPayload extends Packet {
+
+ private String tag;
+ public int length; // CraftBukkit - private -> public
+ private byte[] data;
+
+ public PacketPlayInCustomPayload() {}
+
+ public void a(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws
+ this.tag = packetdataserializer.c(20);
+ this.length = packetdataserializer.readShort();
+ if (this.length > 0 && this.length < 32767) {
+ this.data = new byte[this.length];
+ packetdataserializer.readBytes(this.data);
+ }
+ }
+
+ public void b(PacketDataSerializer packetdataserializer) throws IOException { // CraftBukkit - added throws
+ packetdataserializer.a(this.tag);
+ packetdataserializer.writeShort((short) this.length);
+ if (this.data != null) {
+ packetdataserializer.writeBytes(this.data);
+ }
+ }
+
+ public void a(PacketPlayInListener packetplayinlistener) {
+ packetplayinlistener.a(this);
+ }
+
+ public String c() {
+ return this.tag;
+ }
+
+ public byte[] e() {
+ return this.data;
+ }
+
+ public void handle(PacketListener packetlistener) {
+ this.a((PacketPlayInListener) packetlistener);
+ }
+}