Skip to content

Commit

Permalink
Fixed recursion when sending components
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlll08 committed Feb 19, 2022
1 parent a806bef commit d4b7f8d
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -56,8 +56,8 @@ public static void copy(final Player player, final String toCopy) {
public static void open(final Player player, final File file) {

MutableComponent component = new TranslatableComponent("crafttweaker.command.click.open", new TextComponent(file.getPath()).withStyle(ChatFormatting.GOLD));
send(component.withStyle(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, component))
.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, file.getPath()))), player);
send(component.withStyle(style -> style.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, component.copy()))
.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, file.getPath()))), player);
}

public static String stripNewLine(String string) {
Expand Down

0 comments on commit d4b7f8d

Please sign in to comment.