mirror of
https://github.com/Phoenix616/RandomTeleport.git
synced 2024-11-25 12:06:15 +01:00
Fix duplicate message and only log unexpected errors
This commit is contained in:
parent
b25e38f393
commit
58c1a98005
@ -348,8 +348,14 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI {
|
||||
return true;
|
||||
}).exceptionally(ex -> {
|
||||
sendMessage(sender, "error.location");
|
||||
sender.sendMessage(ex.getMessage());
|
||||
searcher.getTargets().forEach(e -> sendMessage(e, "error.location"));
|
||||
if (!(ex instanceof NotFoundException)) {
|
||||
getLogger().log(Level.SEVERE, "Error while trying to find a location!", ex);
|
||||
}
|
||||
searcher.getTargets().forEach(e -> {
|
||||
if (e != sender) {
|
||||
sendMessage(e, "error.location");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
return searcher;
|
||||
|
Loading…
Reference in New Issue
Block a user