Don't generate 'count' into json if it's 1

This commit is contained in:
Vincent Lee committed 2020-03-25 15:57:53 -05:00
1 parent f88b101b6b
commit e7d1bc2b4b
106 files changed
+109 -211

No files matched your search

@@ -157,7 +157,10 @@ public final class ItemNBTHelper {
*/
public static JsonObject serializeStack(ItemStack stack) {
CompoundNBT nbt = stack.write(new CompoundNBT());
nbt.put("count", nbt.get("Count"));
byte c = nbt.getByte("Count");
if (c != 1) {
nbt.putByte("count", c);
}
nbt.remove("Count");
nbt.put("item", nbt.get("id"));
nbt.remove("id");