mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-03-12 22:59:15 +01:00
Log error if commands cannot be run on leaving.
This commit is contained in:
parent
0324d3e123
commit
1ab7222ca0
@ -170,10 +170,14 @@ public class IslandResetCommand extends ConfirmableCommand {
|
||||
command = command.replace("[player]", member.getName());
|
||||
if (command.startsWith("[SUDO]") && member.isOnline()) {
|
||||
// Execute the command by the player
|
||||
member.performCommand(command.substring(6));
|
||||
if (!member.performCommand(command.substring(6))) {
|
||||
getPlugin().logError("Could not execute leave command for " + member.getName() + ": " + command.substring(6));
|
||||
}
|
||||
} else {
|
||||
// Otherwise execute as the server console
|
||||
getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), command);
|
||||
if (!getPlugin().getServer().dispatchCommand(Bukkit.getConsoleSender(), command)) {
|
||||
getPlugin().logError("Could not execute leave command as console: " + command);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user