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:
Bukkit/Spigot
2011-01-29 16:23:56 +00:00
parent 9755073204
commit df05c36540
18 changed files with 534 additions and 361 deletions

View File

@ -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;