From 7415afdbfd5cc0b404ba1060629b9ce69289978c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 14 Oct 2012 15:57:21 +1100 Subject: [PATCH] Fix map chunk decompressing itself --- .../java/net/minecraft/server/Packet.java | 4 +-- .../minecraft/server/Packet51MapChunk.java | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/main/java/net/minecraft/server/Packet51MapChunk.java diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java index 90ce1d81..059ef114 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -42,9 +42,9 @@ public abstract class Packet { } } - public abstract void a(DataInputStream datainputstream); + public abstract void a(DataInputStream datainputstream) throws IOException; - public abstract void a(DataOutputStream dataoutputstream); + public abstract void a(DataOutputStream dataoutputstream) throws IOException; public abstract void handle(NetHandler nethandler); diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java new file mode 100644 index 00000000..c967b45d --- /dev/null +++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java @@ -0,0 +1,33 @@ +package net.minecraft.server; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +public class Packet51MapChunk extends Packet { + + @Override + public void a(DataInputStream datainputstream) throws IOException { + datainputstream.readInt(); + datainputstream.readInt(); + datainputstream.readBoolean(); + datainputstream.readShort(); + datainputstream.readShort(); + int size = datainputstream.readInt(); + byte[] buf = new byte[size]; + datainputstream.readFully(buf, 0, size); + } + + @Override + public void a(DataOutputStream dataoutputstream) throws IOException { + } + + @Override + public void handle(NetHandler nethandler) { + } + + @Override + public int a() { + return 0; + } +}