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,6 +5,7 @@ import java.io.File;
import java.util.regex.Pattern;
import org.bukkit.event.Event;
import org.bukkit.event.Listener;
/**
* Represents a plugin loader, which handles direct access to specific types
@@ -27,13 +28,12 @@ public interface PluginLoader {
public Pattern[] getPluginFileFilters();
/**
* Calls a player related event with the given details
* Creates and returns an event executor
*
* @param registration Registered information on the plugin to call about this event
* @param type Type of player related event to call
* @param event Event details
* @param type Type of the event executor to create
* @param listener the object that will handle the eventual call back
*/
public void callEvent(RegisteredListener registration, Event event);
public IExecutor createExecutor(Event.Type type, Listener listener);
/**
* Enables the specified plugin