mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
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. By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
8065c9095a
commit
8dc70a4e98
1 changed files with 2 additions and 0 deletions
|
@ -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…
Reference in a new issue