3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Flat item should only write NBT when id != 0

Dieser Commit ist enthalten in:
Myles 2017-12-16 22:17:12 +00:00
Ursprung 246dc34835
Commit bd9096ef6d

Datei anzeigen

@ -18,7 +18,9 @@ public class FlatItemType extends BaseItemType {
Item item = new Item(); Item item = new Item();
item.setId(id); item.setId(id);
item.setAmount(buffer.readByte()); item.setAmount(buffer.readByte());
item.setTag(Type.NBT.read(buffer)); if (id != 0) {
item.setTag(Type.NBT.read(buffer));
}
return item; return item;
} }
} }
@ -30,7 +32,9 @@ public class FlatItemType extends BaseItemType {
} else { } else {
buffer.writeShort(object.getId()); buffer.writeShort(object.getId());
buffer.writeByte(object.getAmount()); buffer.writeByte(object.getAmount());
Type.NBT.write(buffer, object.getTag()); if (object.getId() != 0) {
Type.NBT.write(buffer, object.getTag());
}
} }
} }
} }