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

View File

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