Fixed commands for the Bukkit commands change.

This commit is contained in:
sk89q 2011-01-30 01:03:57 -08:00
parent 5cf38cc885
commit 428fc7e5f6

View File

@ -26,6 +26,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -417,7 +418,14 @@ public void postReload() {
/**
* Handles a command.
*/
public boolean onCommand(Player player, Command cmd, String commandLabel, String[] args) {
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
if (!sender.isPlayer()) {
return true;
}
Player player = (Player)sender;
try {
return handleCommand(player, cmd.getName(), args);
} catch (InsufficientArgumentsException e) {