mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 10:20:42 +01:00
Always flip
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
9f1efb0932
commit
6db55ce91f
@ -153,6 +153,6 @@ public class ItemMeta implements TagReadable, Writeable {
|
||||
w.writeNBT("", nbt);
|
||||
this.cachedBuffer = w.getBuffer();
|
||||
}
|
||||
writer.write(cachedBuffer.flip());
|
||||
writer.write(cachedBuffer);
|
||||
}
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class ChunkDataPacket implements ServerPacket {
|
||||
|
||||
// Data
|
||||
writer.writeVarInt(blocks.position());
|
||||
writer.write(blocks.flip());
|
||||
writer.write(blocks);
|
||||
|
||||
// Block entities
|
||||
if (entries == null || entries.isEmpty()) {
|
||||
|
@ -288,14 +288,11 @@ public class BinaryWriter extends OutputStream {
|
||||
}
|
||||
|
||||
public void write(@NotNull ByteBuffer buffer) {
|
||||
this.buffer.put(buffer);
|
||||
this.buffer.put(buffer.flip());
|
||||
}
|
||||
|
||||
public void write(@NotNull BinaryWriter writer) {
|
||||
var buffer = writer.buffer;
|
||||
final int pos = buffer.position();
|
||||
write(buffer.position(0));
|
||||
buffer.position(pos);
|
||||
write(writer.buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user