More NBT consistency

Normalize empty NBT to null NBT. Fixes stackability for empty inventories, as usual.
This commit is contained in:
abel1502 2025-06-07 00:26:59 +03:00
parent 51ad12d51a
commit e9888a8634
No known key found for this signature in database
GPG Key ID: 076926596A536338

View File

@ -38,7 +38,10 @@ public abstract class ItemInventory implements IInventory {
}
public NBTTagCompound checkNBT(NBTTagCompound nbt) {
if(nbt != null && !nbt.hasNoTags()) {
if(nbt == null || nbt.hasNoTags())
return null;
Random random = new Random();
try {
@ -77,10 +80,10 @@ public abstract class ItemInventory implements IInventory {
}
}
return new NBTTagCompound(); // Reset.
return null; // Reset.
}
} catch (IOException ignored) {}
}
return nbt;
}