Skip to content

Commit

Permalink
- refactor: use translable text for item display in chat module
Browse files Browse the repository at this point in the history
  • Loading branch information
sakurawald committed Jul 15, 2024
1 parent 6730aef commit 524bf75
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ public void registerItemPlaceholder() {
ServerPlayerEntity player = ctx.player();
String displayUUID = DisplayHelper.createItemDisplay(player);
Component replacement =
Component.text("[%s]".formatted(player.getMainHandStack().getName().getString()))
Component.text("[")
.append(Component.translatable(player.getMainHandStack().getTranslationKey()))
.append(Component.text("]"))
.hoverEvent(MessageUtil.ofComponent(player, "display.click.prompt"))
.clickEvent(buildDisplayClickEvent(displayUUID));
return PlaceholderResult.value(MessageUtil.toText(replacement));
Expand Down

0 comments on commit 524bf75

Please sign in to comment.