Refactored event calling so its front loading avoiding the lookup for each event call.
This now uses an annoymous class implementing IExecutor that facilitates direct event method handler calling Changed commands from being executed exclusively by a player to by a CommandSender to facilitate external command callers such as rcon Fixed CustomEventListener Merged in additional events Added getFullName to PluginDescriptionFile which returns the combination of Name and Version There's also a few bits of reformatting as it seems someones been editing with either tabs or dos eol :( By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
@ -3,7 +3,7 @@ package org.bukkit.command;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public abstract class Command {
|
||||
private final String name;
|
||||
@ -17,12 +17,12 @@ public abstract class Command {
|
||||
this.usageMessage = "/" + name;
|
||||
}
|
||||
|
||||
public abstract boolean execute(Player player, String currentAlias, String[] args);
|
||||
|
||||
public abstract boolean execute(CommandSender sender, String currentAlias, String[] args);
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public List<String> getAliases() {
|
||||
return aliases;
|
||||
}
|
||||
@ -34,17 +34,17 @@ public abstract class Command {
|
||||
public String getUsage() {
|
||||
return usageMessage;
|
||||
}
|
||||
|
||||
|
||||
public Command setAliases(List<String> aliases) {
|
||||
this.aliases = aliases;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Command setTooltip(String tooltip) {
|
||||
this.tooltip = tooltip;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Command setUsage(String usage) {
|
||||
this.usageMessage = usage;
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user