mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Don't generate 'count' into json if it's 1
This commit is contained in:
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");
|
||||
|
||||
Reference in new issue
Block a user