From 1b80328d3f58655d4d5f24575962603d53f2e92f Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Mon, 2 Feb 2015 12:09:26 -0800 Subject: [PATCH] Reset S->C CustomPayload data after Write, allowing the same packet to be written multiple times. Closes #588 --- .../play/server/S3FPacketCustomPayload.java.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch diff --git a/fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch b/fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch new file mode 100644 index 0000000000..7278ad7b1b --- /dev/null +++ b/fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch @@ -0,0 +1,14 @@ +--- ../src-base/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java ++++ ../src-work/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java +@@ -46,7 +46,11 @@ + public void func_148840_b(PacketBuffer p_148840_1_) throws IOException + { + p_148840_1_.func_180714_a(this.field_149172_a); ++ synchronized(this) { //This may be access multiple times, from multiple threads, lets be safe. ++ this.field_149171_b.markReaderIndex(); + p_148840_1_.writeBytes((ByteBuf)this.field_149171_b); ++ this.field_149171_b.resetReaderIndex(); ++ } + } + + public void func_180734_a(INetHandlerPlayClient p_180734_1_)