From ee1e229b662848c945d3db9f4565d0dee13b9f3f Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Sun, 7 Jun 2015 00:06:00 -0700 Subject: [PATCH] Change custom payload lock to be buffer itself incase multiple packets use the same backend buffer. Closes #1908 --- .../network/play/client/C17PacketCustomPayload.java.patch | 2 +- .../network/play/server/S3FPacketCustomPayload.java.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fml/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch b/fml/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch index c7acfd978..1345ee125 100644 --- a/fml/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch +++ b/fml/patches/minecraft/net/minecraft/network/play/client/C17PacketCustomPayload.java.patch @@ -4,7 +4,7 @@ public void func_148840_b(PacketBuffer p_148840_1_) throws IOException { p_148840_1_.func_180714_a(this.field_149562_a); -+ synchronized(this) { //This may be access multiple times, from multiple threads, lets be safe. ++ synchronized(this.field_149561_c) { //This may be access multiple times, from multiple threads, lets be safe. + this.field_149561_c.markReaderIndex(); p_148840_1_.writeBytes((ByteBuf)this.field_149561_c); + this.field_149561_c.resetReaderIndex(); 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 index 7278ad7b1..ae048b6b5 100644 --- a/fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch +++ b/fml/patches/minecraft/net/minecraft/network/play/server/S3FPacketCustomPayload.java.patch @@ -4,7 +4,7 @@ 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. ++ synchronized(this.field_149171_b) { //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();