Add missing conditions to 1.20.5 item type writing (#3913)

This commit is contained in:
EnZaXD 2024-06-06 19:30:03 +02:00 committed by GitHub
parent bb48dc90f9
commit d43ad37663
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,7 +82,7 @@ public class ItemType1_20_5 extends Type<Item> {
@Override
public void write(final ByteBuf buffer, @Nullable final Item object) {
if (object == null) {
if (object == null || object.identifier() == 0 || object.amount() <= 0) {
Types.VAR_INT.writePrimitive(buffer, 0);
return;
}