From a880637c4065cf7294d17bc4efa57a89d0646efb Mon Sep 17 00:00:00 2001 From: Arasple Date: Mon, 20 Jan 2020 19:56:04 +0800 Subject: [PATCH] fix TLocaleJSON url --- .../io/izzel/taboolib/module/locale/type/TLocaleJson.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/io/izzel/taboolib/module/locale/type/TLocaleJson.java b/src/main/scala/io/izzel/taboolib/module/locale/type/TLocaleJson.java index 6eb160b..90ab38a 100644 --- a/src/main/scala/io/izzel/taboolib/module/locale/type/TLocaleJson.java +++ b/src/main/scala/io/izzel/taboolib/module/locale/type/TLocaleJson.java @@ -74,9 +74,11 @@ public class TLocaleJson extends TLocaleSerialize { BaseComponent[] component = TextComponent.fromLegacyText(text); arg.forEach((key, value) -> { if (key.equalsIgnoreCase("suggest")) { - Arrays.stream(component).forEach(baseComponent -> baseComponent.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, String.valueOf(value)))); + Arrays.stream(component).forEach(baseComponent -> baseComponent. setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, String.valueOf(value)))); } else if (key.equalsIgnoreCase("command") || "commands".equalsIgnoreCase(key)) { Arrays.stream(component).forEach(baseComponent -> baseComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.valueOf(value)))); + } else if (key.equalsIgnoreCase("url")) { + Arrays.stream(component).forEach(baseComponent -> baseComponent.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, String.valueOf(value)))); } else if (key.equalsIgnoreCase("hover")) { Arrays.stream(component).forEach(baseComponent -> baseComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(TLocale.Translate.setColored(String.valueOf(value))).create()))); }