All code to call events and delegate back to plugins

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot
2010-12-26 00:21:00 +00:00
parent 130fc2576a
commit acc9067060
9 changed files with 187 additions and 13 deletions

View File

@ -2,6 +2,7 @@
package org.bukkit.plugin;
import java.io.File;
import org.bukkit.event.player.PlayerEvent;
/**
* Handles all plugin management from the Server
@ -14,7 +15,7 @@ public interface PluginManager {
* @param loader Class name of the PluginLoader to register
* @throws IllegalArgumentException Thrown when the given Class is not a valid PluginLoader
*/
void RegisterInterface(Class loader) throws IllegalArgumentException;
public void RegisterInterface(Class loader) throws IllegalArgumentException;
/**
* Checks if the given plugin is loaded and returns it when applicable
@ -24,7 +25,7 @@ public interface PluginManager {
* @param name Name of the plugin to check
* @return Plugin if it exists, otherwise null
*/
Plugin getPlugin(String name);
public Plugin getPlugin(String name);
/**
* Checks if the given plugin is enabled or not
@ -34,7 +35,7 @@ public interface PluginManager {
* @param name Name of the plugin to check
* @return true if the plugin is enabled, otherwise false
*/
boolean isPluginEnabled(String name);
public boolean isPluginEnabled(String name);
/**
* Checks if the given plugin is enabled or not
@ -42,7 +43,7 @@ public interface PluginManager {
* @param plugin Plugin to check
* @return true if the plugin is enabled, otherwise false
*/
boolean isPluginEnabled(Plugin plugin);
public boolean isPluginEnabled(Plugin plugin);
/**
* Loads the plugin in the specified file
@ -53,7 +54,7 @@ public interface PluginManager {
* @return The Plugin loaded, or null if it was invalid
* @throws InvalidPluginException Thrown when the specified file is not a valid plugin
*/
Plugin loadPlugin(File file) throws InvalidPluginException;
public Plugin loadPlugin(File file) throws InvalidPluginException;
/**
* Loads the plugins contained within the specified directory
@ -61,5 +62,13 @@ public interface PluginManager {
* @param directory Directory to check for plugins
* @return A list of all plugins loaded
*/
Plugin[] loadPlugins(File directory);
public Plugin[] loadPlugins(File directory);
/**
* Calls a player related event with the given details
*
* @param type Type of player related event to call
* @param event Event details
*/
public void callEvent(PlayerEvent.EventType type, PlayerEvent event);
}