Skip to content

Commit

Permalink
Update ServuxStructuresPacket.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbianxiao authored Sep 18, 2024
1 parent d5e4d18 commit a6feb7d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ public void toPacket(PacketByteBuf output)
// Write Packet Buffer
try
{
output.writeBytes(this.buffer.readBytes(this.buffer.readableBytes()));
PacketByteBuf copiedBuffer = new PacketByteBuf(this.buffer.copy());
output.writeBytes(copiedBuffer.readBytes(copiedBuffer.readableBytes()));
}
catch (Exception e)
{
Servux.logger.error("ServuxStructuresPacket#toPacket: error writing data to packet: [{}]", e.getLocalizedMessage());
}
}
}
}
else
{
// Write NBT
Expand Down

0 comments on commit a6feb7d

Please sign in to comment.