Reset S->C CustomPayload data after Write, allowing the same packet to be written multiple times. Closes #588

This commit is contained in:
Lex Manos 2015-02-02 12:09:26 -08:00
parent 79b5c28d38
commit 1b80328d3f
1 changed files with 14 additions and 0 deletions

View File

@ -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_)