Skip to content

Commit

Permalink
feat(ench): hide proficiency for book
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Feb 21, 2024
1 parent 4c6d7fc commit 11879ed
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,14 @@ public float getBreakSpeed(int lvl, ItemStack itemStack, Player player, BlockSta
@Override
@OnlyIn(Dist.CLIENT)
public void onItemTooltip(int lvl, @NotNull ItemStack itemStack, @Nullable Player player, List<Component> lines, TooltipFlag flags) {
EnchantmentHelper.getEnchantmentTooltip(lines, this.getDescriptionId())
.ifPresent(
(text) -> ((MutableComponent) text)
.append(" ")
.append(Component.translatable(getDescriptionId() + ".proficiency", getProficiency(itemStack)))
);
if (EnchantmentHelper.NOT_BOOK.test(itemStack)) {
EnchantmentHelper.getEnchantmentTooltip(lines, this.getDescriptionId())
.ifPresent(
(text) -> ((MutableComponent) text)
.append(" ")
.append(Component.translatable(getDescriptionId() + ".proficiency", getProficiency(itemStack)))
);
}
}

}

0 comments on commit 11879ed

Please sign in to comment.