diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBanner.java index d61615bfad..713d70cd1b 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 serialize(ImmutableMap.Builder 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 c9738c4f09..1f7b5239aa 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., String>builder() + .put(CraftMetaBanner.class, "BANNER") .put(CraftMetaBook.class, "BOOK") .put(CraftMetaSkull.class, "SKULL") .put(CraftMetaLeatherArmor.class, "LEATHER_ARMOR")