Change custom payload lock to be buffer itself incase multiple packets use the same backend buffer. Closes #1908
This commit is contained in:
parent
e007f7cf39
commit
ee1e229b66
2 changed files with 2 additions and 2 deletions
|
@ -4,7 +4,7 @@
|
||||||
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException
|
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException
|
||||||
{
|
{
|
||||||
p_148840_1_.func_180714_a(this.field_149562_a);
|
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();
|
+ this.field_149561_c.markReaderIndex();
|
||||||
p_148840_1_.writeBytes((ByteBuf)this.field_149561_c);
|
p_148840_1_.writeBytes((ByteBuf)this.field_149561_c);
|
||||||
+ this.field_149561_c.resetReaderIndex();
|
+ this.field_149561_c.resetReaderIndex();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException
|
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException
|
||||||
{
|
{
|
||||||
p_148840_1_.func_180714_a(this.field_149172_a);
|
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();
|
+ this.field_149171_b.markReaderIndex();
|
||||||
p_148840_1_.writeBytes((ByteBuf)this.field_149171_b);
|
p_148840_1_.writeBytes((ByteBuf)this.field_149171_b);
|
||||||
+ this.field_149171_b.resetReaderIndex();
|
+ this.field_149171_b.resetReaderIndex();
|
||||||
|
|
Loading…
Reference in a new issue