Skip to content

Commit

Permalink
Fixed ItemStack converter
Browse files Browse the repository at this point in the history
  • Loading branch information
terminalsin committed Oct 23, 2020
1 parent f970f89 commit b00154a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ public void write(MutableByteBuf buffer, ItemStack value) {
@Override
public ItemStack read(MutableByteBuf buffer, Object... args) throws IOException {
short id = buffer.readShort();
byte amount = buffer.readByte();
Object tag = Converters.NMS_NBT.read(buffer);
WrappedItem item = new WrappedItem(id, amount, tag);
return ReflectUtil.getItemFromWrapper(item);
if (id >= 0) {
byte amount = buffer.readByte();
short data = buffer.readShort();
Object tag = Converters.NMS_NBT.read(buffer);
WrappedItem item = new WrappedItem(id, amount, data, tag);
return ReflectUtil.getItemFromWrapper(item);
}
return null;
}
}

0 comments on commit b00154a

Please sign in to comment.