Renamed IExecutor -> CommandExecutor and fixed SERVER_COMMAND doc

By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
Bukkit/Spigot
2011-01-29 21:17:36 +00:00
parent e56db60b83
commit 6f4cf0388b
10 changed files with 65 additions and 70 deletions

View File

@@ -10,10 +10,16 @@ public interface CommandSender {
public void sendMessage(String message);
/**
* Checks if this player is currently op
* Checks if this sender is currently op
*
* @return true if they are
*/
public boolean isOp();
/**
* Checks if this sender is a player
*
* @return true if they are
*/
public boolean isPlayer();
}

View File

@@ -196,12 +196,12 @@ public final class SimpleCommandMap implements CommandMap {
}
@Override
public boolean execute(Player player, String currentAlias, String[] args) {
if (player.isOp()) {
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (sender.isOp()) {
server.reload();
player.sendMessage(ChatColor.GREEN + "Reload complete.");
sender.sendMessage(ChatColor.GREEN + "Reload complete.");
} else {
player.sendMessage(ChatColor.RED + "You do not have sufficient access" + " to reload this server.");
sender.sendMessage(ChatColor.RED + "You do not have sufficient access" + " to reload this server.");
}
return true;
}