mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-23 11:15:24 +01:00
Fixed bug with running onLeave commands (#1929)
In discord, it was reported that running the admin delete command produces a null-pointer if `[player]` placeholder is used. With fast checking I found out the issue: incorrect user was passed to the command. Also, I moved runCommands below all resets, so commands could be used to give items, or xp or other stuff that is removed.
This commit is contained in:
parent
da98bbcf38
commit
3ecdda65b5
@ -96,8 +96,6 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
}
|
||||
|
||||
private void cleanUp(User user, User target) {
|
||||
// Execute commands when leaving
|
||||
Util.runCommands(user, getIWM().getOnLeaveCommands(getWorld()), "leave");
|
||||
// Remove money inventory etc.
|
||||
if (getIWM().isOnLeaveResetEnderChest(getWorld())) {
|
||||
target.getPlayer().getEnderChest().clear();
|
||||
@ -123,6 +121,8 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
target.getPlayer().setTotalExperience(0);
|
||||
}
|
||||
|
||||
// Execute commands when leaving
|
||||
Util.runCommands(target, getIWM().getOnLeaveCommands(getWorld()), "leave");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,4 +135,4 @@ public class AdminDeleteCommand extends ConfirmableCommand {
|
||||
List<String> options = new ArrayList<>(Util.getOnlinePlayerList(user));
|
||||
return Optional.of(Util.tabLimit(options, lastArg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user