Don't try listing something that may not exist. Fixes BUKKIT-3471
The player name may not be provided, in which case the command will fail hard.
This commit is contained in:
parent
05c2c55fce
commit
0d14642362
@ -62,6 +62,8 @@ public class ClearCommand extends VanillaCommand {
|
|||||||
int count = player.getInventory().clear(id, data);
|
int count = player.getInventory().clear(id, data);
|
||||||
|
|
||||||
Command.broadcastCommandMessage(sender, "Cleared the inventory of " + player.getDisplayName() + ", removing " + count + " items");
|
Command.broadcastCommandMessage(sender, "Cleared the inventory of " + player.getDisplayName() + ", removing " + count + " items");
|
||||||
|
} else if (args.length == 0) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Please provide a player!");
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.RED + "Can't find player " + args[0]);
|
sender.sendMessage(ChatColor.RED + "Can't find player " + args[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user