From d4b7f8d8764c2633a95e816f524d2b0c49e5a54c Mon Sep 17 00:00:00 2001 From: Jared Date: Sat, 19 Feb 2022 02:20:18 +0200 Subject: [PATCH] Fixed recursion when sending components --- .../blamejared/crafttweaker/api/command/CommandUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/src/main/java/com/blamejared/crafttweaker/api/command/CommandUtilities.java b/Common/src/main/java/com/blamejared/crafttweaker/api/command/CommandUtilities.java index 80b4ff6de..85f2c0e98 100644 --- a/Common/src/main/java/com/blamejared/crafttweaker/api/command/CommandUtilities.java +++ b/Common/src/main/java/com/blamejared/crafttweaker/api/command/CommandUtilities.java @@ -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) {