diff --git a/changelog.txt b/changelog.txt index cda2dfcd..05c48198 100644 --- a/changelog.txt +++ b/changelog.txt @@ -477,6 +477,7 @@ Improvements Bug Fixes: - Fixed bug with players getting kicked out of teams when running /teama create (#292) - Fixed case sensitivity issues with player names (#288) +- Fixed bug causing NoSuchMethod error with "@" in commands (#287) TODO (any TODO which is not specifically code), mainly used for reminders to update documentation diff --git a/src/main/java/com/booksaw/betterTeams/BooksawCommand.java b/src/main/java/com/booksaw/betterTeams/BooksawCommand.java index ada73029..9b0d00e8 100644 --- a/src/main/java/com/booksaw/betterTeams/BooksawCommand.java +++ b/src/main/java/com/booksaw/betterTeams/BooksawCommand.java @@ -85,14 +85,18 @@ public boolean checkPointers(CommandSender sender, String label, String[] args) } // a selector is found boolean found = false; - for (Entity e : Bukkit.selectEntities(sender, str)) { - if (e instanceof Player) { - found = true; - String[] newArgs = args.clone(); - newArgs[i] = e.getName(); - execute(sender, label, newArgs); - + try { + for (Entity e : Bukkit.selectEntities(sender, str)) { + if (e instanceof Player) { + found = true; + String[] newArgs = args.clone(); + newArgs[i] = e.getName(); + execute(sender, label, newArgs); + + } } + } catch (Exception e) { + return false; } return found;