Skip to content

Commit

Permalink
Updated deprecated NBT methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Nan1t committed Jan 23, 2022
1 parent 2e69580 commit 1d75272
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/ru/nanit/limbo/protocol/ByteMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public byte[] toByteArray() {
return bytes;
}

/* Minecraft protocol methods */
/* Minecraft's protocol methods */

public int readVarInt() {
int i = 0;
Expand Down Expand Up @@ -149,7 +149,7 @@ public void writeCompoundTagArray(CompoundBinaryTag[] compoundTags) {
writeVarInt(compoundTags.length);

for (CompoundBinaryTag tag : compoundTags) {
BinaryTagIO.writeDataOutput(tag, stream);
BinaryTagIO.writer().write(tag, (OutputStream) stream);
}
} catch (IOException e) {
throw new EncoderException("Cannot write NBT CompoundTag");
Expand All @@ -158,15 +158,15 @@ public void writeCompoundTagArray(CompoundBinaryTag[] compoundTags) {

public CompoundBinaryTag readCompoundTag() {
try {
return BinaryTagIO.readDataInput(new ByteBufInputStream(buf));
return BinaryTagIO.reader().read((InputStream) new ByteBufInputStream(buf));
} catch (IOException thrown) {
throw new DecoderException("Cannot read NBT CompoundTag");
}
}

public void writeCompoundTag(CompoundBinaryTag compoundTag) {
try {
BinaryTagIO.writeDataOutput(compoundTag, new ByteBufOutputStream(buf));
BinaryTagIO.writer().write(compoundTag, (OutputStream) new ByteBufOutputStream(buf));
} catch (IOException e) {
throw new EncoderException("Cannot write NBT CompoundTag");
}
Expand Down

0 comments on commit 1d75272

Please sign in to comment.