Merge pull request #22 in SPIGOT/craftbukkit from ~FEARTHE1337/craftbukkit:fixCraftMetaBanner to master

* commit 'f75756a2e3542f67099dc24b283cc601360a87cf':
  Fix CraftMetaBanner serialization.

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot 2014-12-02 16:47:25 +01:00
commit 042816193c
2 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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")