Polymer

Polymer

763k Downloads

Polymer should not add the JukeboxSong to the Lore

Binero opened this issue ยท 0 comments

commented

When an item has a JukeBox line it is added to the Lore.

var tooltip = itemStack.getTooltip(player != null ? Item.TooltipContext.create(player.getWorld()) : Item.TooltipContext.DEFAULT, player, tooltipContext);
if (!tooltip.isEmpty()) {
out.set(DataComponentTypes.ITEM_NAME, tooltip.remove(0));
if (itemStack.getItem() instanceof PolymerItem) {
((PolymerItem) itemStack.getItem()).modifyClientTooltip(tooltip, itemStack, player);
}
var lore = new ArrayList<Text>();
for (Text t : tooltip) {
lore.add(Text.empty().append(t).setStyle(PolymerItemUtils.CLEAN_STYLE));
}
out.set(DataComponentTypes.LORE, new LoreComponent(lore));
}

Vanilla clients already display this tooltip line correctly, so it should not be added again. Doing so results the jukebox song name to appear twice.