diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java | 9 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java index d61615bf..713d70cd 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java @@ -145,8 +145,13 @@ public class CraftMetaBanner extends CraftMetaItem implements BannerMeta { ImmutableMap.Builder<String, Object> serialize(ImmutableMap.Builder<String, Object> builder) { super.serialize(builder); - builder.put(BASE.BUKKIT, base); - builder.put(PATTERNS.BUKKIT, ImmutableList.copyOf(patterns)); + if(base != null){ + builder.put(BASE.BUKKIT, base); + } + + if(!patterns.isEmpty()){ + builder.put(PATTERNS.BUKKIT, ImmutableList.copyOf(patterns)); + } return builder; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index c9738c4f..1f7b5239 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -96,6 +96,7 @@ class CraftMetaItem implements ItemMeta, Repairable { static { classMap = ImmutableMap.<Class<? extends CraftMetaItem>, String>builder() + .put(CraftMetaBanner.class, "BANNER") .put(CraftMetaBook.class, "BOOK") .put(CraftMetaSkull.class, "SKULL") .put(CraftMetaLeatherArmor.class, "LEATHER_ARMOR") |