Skip to content

Commit

Permalink
Fixed NoSuchMethod error with entity selector
Browse files Browse the repository at this point in the history
Issue Reference: #287
  • Loading branch information
booksaw committed Dec 22, 2021
1 parent 92df1a6 commit 9cc9ce3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 11 additions & 7 deletions src/main/java/com/booksaw/betterTeams/BooksawCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9cc9ce3

Please sign in to comment.