Skip to content

Commit

Permalink
hack-fix to prevent blank shields showing up as white
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 20, 2020
1 parent f7a213e commit cbc5439
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -58,6 +58,11 @@ private ItemBaseColor(ItemTag item) {
private DyeColor getBaseColor() {
ItemMeta itemMeta = item.getItemStack().getItemMeta();
if (itemMeta instanceof BlockStateMeta) {
if (item.getItemStack().getType() == Material.SHIELD) { // Hack to avoid blank shields misdisplaying as white
if (!itemMeta.serialize().containsKey("internal")) {
return null;
}
}
return ((Banner) ((BlockStateMeta) itemMeta).getBlockState()).getBaseColor();
}
else {
Expand Down

0 comments on commit cbc5439

Please sign in to comment.