Fix shield color nullpointer

This commit is contained in:
timderspieler 2018-10-20 15:54:04 +02:00
parent 1dbf31a223
commit f4e1f8fb32

View File

@ -219,7 +219,10 @@ public class Methods {
case SHIELD:
BlockStateMeta shieldMeta = (BlockStateMeta) item.getItemMeta();
Banner shieldBannerMeta = (Banner) shieldMeta.getBlockState();
int basecolor = shieldBannerMeta.getBaseColor().getColor().asRGB();
int basecolor = 0;
if (shieldBannerMeta.getBaseColor() != null) {
basecolor = shieldBannerMeta.getBaseColor().getColor().asRGB();
}
str.append("basecolor:").append(basecolor).append(" ");
for (org.bukkit.block.banner.Pattern p : shieldBannerMeta.getPatterns()) {
String type = p.getPattern().getIdentifier();