mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 05:03:55 -07:00
Renamed IExecutor -> CommandExecutor and fixed SERVER_COMMAND doc
By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
@@ -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();
|
||||
}
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user