From a1e46fb00ff7c7f55cc14e1efa03e9c1e880c7c7 Mon Sep 17 00:00:00 2001 From: byBackfish Date: Fri, 8 Jul 2022 11:15:40 +0200 Subject: [PATCH] make the `here` command component run `/am find` instead of `/find`. This way you can also find players that are in streamer mode --- src/main/java/tk/avicia/avomod/features/ChatUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/tk/avicia/avomod/features/ChatUtils.java b/src/main/java/tk/avicia/avomod/features/ChatUtils.java index 3be4f2e..44eb5ba 100644 --- a/src/main/java/tk/avicia/avomod/features/ChatUtils.java +++ b/src/main/java/tk/avicia/avomod/features/ChatUtils.java @@ -202,7 +202,7 @@ public static boolean checkIfGuildChat(ITextComponent textComponent) { return pattern.matcher(messageString).find(); } - // Adds a clickevent to every "here" in guild chat that runs /find similar to wynntils' coordindates + // Adds a clickevent to every "here" in guild chat that runs `/am find ` similar to wynntils' coordindates private static void makeHereRunFindCommand(ITextComponent textComponent) { if (checkIfGuildChat(textComponent)) { String fullMessage = TextFormatting.getTextWithoutFormattingCodes(textComponent.getUnformattedText()); @@ -218,7 +218,7 @@ private static void makeHereRunFindCommand(ITextComponent textComponent) { if (!siblingText.contains(splitString) || fullMessage == null) return; temp.appendSibling(new TextComponentString(TextFormatting.AQUA + siblingText.substring(0, siblingText.indexOf(splitString)))); - String command = "/find " + (fullMessage.substring(fullMessage.lastIndexOf("\u2605") == -1 ? + String command = "/am find " + (fullMessage.substring(fullMessage.lastIndexOf("\u2605") == -1 ? 1 : fullMessage.lastIndexOf("\u2605") + 1, fullMessage.indexOf("]"))); // If the person typing "here" is nicked HoverEvent hover = textComponent.getStyle().getHoverEvent(); @@ -227,7 +227,7 @@ private static void makeHereRunFindCommand(ITextComponent textComponent) { String hoverText = hover.getValue().getUnformattedText(); if (hoverText.contains("real username") && hoverText.contains("Rank:")) { String realName = hoverText.split(" ")[hoverText.split(" ").length - 1]; - command = "/find " + realName; + command = "/am find " + realName; } ITextComponent hereComponent = new TextComponentString(TextFormatting.UNDERLINE + splitString + TextFormatting.RESET);