Permalink
Browse files

Fix shield banner meta

  • Loading branch information...
PseudoKnight committed Aug 25, 2018
1 parent da9e727 commit 39e685ff195158f15c20a34e20fea660000a447a
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/main/java/com/laytonsmith/core/ObjectGenerator.java
@@ -444,7 +444,6 @@ public Construct itemMeta(MCItemStack is, Target t) {
ma.set("inventory", box, t);
} else if(bs instanceof MCBanner) {
MCBanner banner = (MCBanner) bs;
ma.set("basecolor", banner.getBaseColor().name());
CArray patterns = new CArray(t, banner.numberOfPatterns());
for(MCPattern p : banner.getPatterns()) {
CArray pattern = CArray.GetAssociativeArray(t);
@@ -705,12 +704,13 @@ public MCItemMeta itemMeta(Construct c, MCMaterial mat, Target t) throws ConfigR
}
} else if(bs instanceof MCBanner) {
MCBanner banner = (MCBanner) bs;
banner.setBaseColor(MCDyeColor.WHITE);
if(ma.containsKey("basecolor")) {
MCDyeColor base = MCDyeColor.valueOf(ma.get("basecolor", t).val().toUpperCase());
banner.addPattern(StaticLayer.GetConvertor().GetPattern(base, MCPatternShape.BASE));
}
if(ma.containsKey("patterns")) {
CArray array = ArgumentValidation.getArray(ma.get("patterns", t), t);
if(ma.containsKey("basecolor")) {
MCDyeColor base = MCDyeColor.valueOf(ma.get("basecolor", t).val().toUpperCase());
banner.setBaseColor(base);
}
for(String key : array.stringKeySet()) {
CArray pattern = ArgumentValidation.getArray(array.get(key, t), t);
MCPatternShape shape = MCPatternShape.valueOf(pattern.get("shape", t).val().toUpperCase());
@@ -728,7 +728,6 @@ public MCItemMeta itemMeta(Construct c, MCMaterial mat, Target t) throws ConfigR
}
}
}
banner.update();
bsm.setBlockState(banner);
} else if(bs instanceof MCCreatureSpawner) {
MCCreatureSpawner mccs = (MCCreatureSpawner) bs;

0 comments on commit 39e685f

Please sign in to comment.