Change custom payload lock to be buffer itself incase multiple packets use the same backend buffer. Closes #1908

This commit is contained in:
Lex Manos 2015-06-07 00:06:00 -07:00
parent e007f7cf39
commit ee1e229b66
2 changed files with 2 additions and 2 deletions

View file

@ -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();

View file

@ -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();