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

@@ -5,7 +5,7 @@ import org.bukkit.entity.Player;
public interface CommandMap {
/**
* Registers all the commands belonging to a certain plugin.
* Registers all the commands belonging to a certain plugin.
* @param plugin
* @return
*/
@@ -13,17 +13,17 @@ public interface CommandMap {
/**
* Registers a command. Returns true on success; false if name is already taken and fallback had to be used.
*
*
* @param a label for this command, without the '/'-prefix.
* @return Returns true if command was registered; false if label was already in use.
*/
public boolean register(String label, String fallbackPrefix, Command command);
/** Looks for the requested command and executes it if found.
*
*
* @param cmdLine command + arguments. Example: "/test abc 123"
* @return targetFound returns false if no target is found.
*/
public boolean dispatch(Player sender, String cmdLine);
public boolean dispatch(CommandSender sender, String cmdLine);
}