Skip to content

Commit

Permalink
check if items in item frames have a custom name
Browse files Browse the repository at this point in the history
  • Loading branch information
steve4744 committed Dec 16, 2023
1 parent 21626a9 commit cc33786
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ public String getEntityDisplayName(Entity entity, Player player) {
} else if (entity.getType() == EntityType.ITEM_FRAME || entity.getType() == EntityType.GLOW_ITEM_FRAME) {
final ItemFrame iframe = (ItemFrame) entity;
if (plugin.getSettings().isItemFrameContentEnabled() && iframe.getItem().getType() != Material.AIR) {
targetName = translateItemName(iframe.getItem().getType().toString(), player);
if (iframe.getItem().getItemMeta() != null && iframe.getItem().getItemMeta().hasDisplayName()) {
targetName = iframe.getItem().getItemMeta().getDisplayName();
} else {
targetName = translateItemName(iframe.getItem().getType().toString(), player);
}
}
}

Expand Down

0 comments on commit cc33786

Please sign in to comment.