Apply empty pattern list instead of bare null

This commit is contained in:
Mark Vainomaa 2016-08-31 14:57:32 +03:00
parent 65656c1ac9
commit d7d9166eab
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ public class Shield {
ItemMeta shieldMeta = shieldStack.getItemMeta();
BlockStateMeta shieldbMeta = (BlockStateMeta)shieldMeta;
// Create empty pattern list if null is supplied
if(patternList == null)
patternList = new ArrayList<>();
Banner banner = (Banner)shieldbMeta.getBlockState();
banner.setPatterns(patternList);
banner.update(); // TODO: find out if it is needed