Skip to content

Commit

Permalink
make the here command component run /am find instead of /find. …
Browse files Browse the repository at this point in the history
…This way you can also find players that are in streamer mode
  • Loading branch information
byBackfish committed Jul 8, 2022
1 parent 104a306 commit a1e46fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/tk/avicia/avomod/features/ChatUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Player> similar to wynntils' coordindates
// Adds a clickevent to every "here" in guild chat that runs `/am find <Player>` similar to wynntils' coordindates
private static void makeHereRunFindCommand(ITextComponent textComponent) {
if (checkIfGuildChat(textComponent)) {
String fullMessage = TextFormatting.getTextWithoutFormattingCodes(textComponent.getUnformattedText());
Expand All @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit a1e46fb

Please sign in to comment.