mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-26 19:17:40 +01:00
Make sure to check for correct arguments.
This commit is contained in:
parent
e44894a803
commit
212c690117
@ -33,6 +33,11 @@ public class AdminUnregisterCommand extends ConfirmableCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExecute(User user, String label, List<String> args) {
|
public boolean canExecute(User user, String label, List<String> args) {
|
||||||
|
// If args are not right, show help
|
||||||
|
if (args.size() != 1) {
|
||||||
|
showHelp(this, user);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Get target
|
// Get target
|
||||||
UUID targetUUID = getPlayers().getUUID(args.get(0));
|
UUID targetUUID = getPlayers().getUUID(args.get(0));
|
||||||
if (targetUUID == null) {
|
if (targetUUID == null) {
|
||||||
@ -48,11 +53,6 @@ public class AdminUnregisterCommand extends ConfirmableCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, String label, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// If args are not right, show help
|
|
||||||
if (args.size() != 1) {
|
|
||||||
showHelp(this, user);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Get target
|
// Get target
|
||||||
UUID targetUUID = getPlayers().getUUID(args.get(0));
|
UUID targetUUID = getPlayers().getUUID(args.get(0));
|
||||||
// Everything's fine, we can set the island as spawn :)
|
// Everything's fine, we can set the island as spawn :)
|
||||||
|
Loading…
Reference in New Issue
Block a user