Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.plugin.PluginManager Interface Reference

Handles all plugin management from the Server. More...

+ Inheritance diagram for org.bukkit.plugin.PluginManager:

Public Member Functions

void registerInterface (Class<?extends PluginLoader > loader) throws IllegalArgumentException
 Registers the specified plugin loader.
 
Plugin getPlugin (String name)
 Checks if the given plugin is loaded and returns it when applicable.
 
Plugin[] getPlugins ()
 Gets a list of all currently loaded plugins.
 
boolean isPluginEnabled (String name)
 Checks if the given plugin is enabled or not.
 
boolean isPluginEnabled (Plugin plugin)
 Checks if the given plugin is enabled or not.
 
Plugin loadPlugin (File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException
 Loads the plugin in the specified file.
 
Plugin[] loadPlugins (File directory)
 Loads the plugins contained within the specified directory.
 
void disablePlugins ()
 Disables all the loaded plugins.
 
void clearPlugins ()
 Disables and removes all plugins.
 
void callEvent (Event event) throws IllegalStateException
 Calls an event with the given details.
 
void registerEvents (Listener listener, Plugin plugin)
 Registers all the events in the given listener class.
 
void registerEvent (Class<?extends Event > event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin)
 Registers the specified executor to the given event class.
 
void registerEvent (Class<?extends Event > event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin, boolean ignoreCancelled)
 Registers the specified executor to the given event class.
 
void enablePlugin (Plugin plugin)
 Enables the specified plugin.
 
void disablePlugin (Plugin plugin)
 Disables the specified plugin.
 
Permission getPermission (String name)
 Gets a Permission from its fully qualified name.
 
void addPermission (Permission perm)
 Adds a Permission to this plugin manager.
 
void removePermission (Permission perm)
 Removes a Permission registration from this plugin manager.
 
void removePermission (String name)
 Removes a Permission registration from this plugin manager.
 
Set< PermissiongetDefaultPermissions (boolean op)
 Gets the default permissions for the given op status.
 
void recalculatePermissionDefaults (Permission perm)
 Recalculates the defaults for the given Permission.
 
void subscribeToPermission (String permission, Permissible permissible)
 Subscribes the given Permissible for information about the requested Permission, by name.
 
void unsubscribeFromPermission (String permission, Permissible permissible)
 Unsubscribes the given Permissible for information about the requested Permission, by name.
 
Set< PermissiblegetPermissionSubscriptions (String permission)
 Gets a set containing all subscribed Permissibles to the given permission, by name.
 
void subscribeToDefaultPerms (boolean op, Permissible permissible)
 Subscribes to the given Default permissions by operator status.
 
void unsubscribeFromDefaultPerms (boolean op, Permissible permissible)
 Unsubscribes from the given Default permissions by operator status.
 
Set< PermissiblegetDefaultPermSubscriptions (boolean op)
 Gets a set containing all subscribed Permissibles to the given default list, by op status.
 
Set< PermissiongetPermissions ()
 Gets a set of all registered permissions.
 
boolean useTimings ()
 Returns whether or not timing code should be used for event calls.
 

Detailed Description

Handles all plugin management from the Server.

Definition at line 15 of file PluginManager.java.

Member Function Documentation

void org.bukkit.plugin.PluginManager.addPermission ( Permission  perm)

Adds a Permission to this plugin manager.

If a permission is already defined with the given name of the new permission, an exception will be thrown.

Parameters
permPermission to add
Exceptions
IllegalArgumentExceptionThrown when a permission with the same name already exists

Referenced by org.bukkit.permissions.Permission.addParent(), and org.bukkit.util.permissions.DefaultPermissions.registerPermission().

void org.bukkit.plugin.PluginManager.callEvent ( Event  event) throws IllegalStateException

Calls an event with the given details.

Parameters
eventEvent details
Exceptions
IllegalStateExceptionThrown when an asynchronous event is fired from synchronous code.
Note: This is best-effort basis, and should not be used to test synchronized state. This is an indicator for flawed flow logic.

Referenced by org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(), org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(), org.bukkit.command.defaults.KillCommand.execute(), org.bukkit.plugin.SimpleServicesManager.unregister(), and org.bukkit.plugin.SimpleServicesManager.unregisterAll().

void org.bukkit.plugin.PluginManager.clearPlugins ( )

Disables and removes all plugins.

void org.bukkit.plugin.PluginManager.disablePlugin ( Plugin  plugin)

Disables the specified plugin.

Attempting to disable a plugin that is not enabled will have no effect

Parameters
pluginPlugin to disable
void org.bukkit.plugin.PluginManager.disablePlugins ( )

Disables all the loaded plugins.

void org.bukkit.plugin.PluginManager.enablePlugin ( Plugin  plugin)

Enables the specified plugin.

Attempting to enable a plugin that is already enabled will have no effect

Parameters
pluginPlugin to enable
Set<Permission> org.bukkit.plugin.PluginManager.getDefaultPermissions ( boolean  op)

Gets the default permissions for the given op status.

Parameters
opWhich set of default permissions to get
Returns
The default permissions

Referenced by org.bukkit.permissions.PermissibleBase.recalculatePermissions().

Set<Permissible> org.bukkit.plugin.PluginManager.getDefaultPermSubscriptions ( boolean  op)

Gets a set containing all subscribed Permissibles to the given default list, by op status.

Parameters
opDefault list to query for
Returns
Set containing all subscribed permissions
Permission org.bukkit.plugin.PluginManager.getPermission ( String  name)

Gets a Permission from its fully qualified name.

Parameters
nameName of the permission
Returns
Permission, or null if none

Referenced by org.bukkit.permissions.Permission.addParent(), org.bukkit.permissions.PermissibleBase.hasPermission(), and org.bukkit.util.permissions.DefaultPermissions.registerPermission().

Set<Permission> org.bukkit.plugin.PluginManager.getPermissions ( )

Gets a set of all registered permissions.

This set is a copy and will not be modified live.

Returns
Set containing all current registered permissions
Set<Permissible> org.bukkit.plugin.PluginManager.getPermissionSubscriptions ( String  permission)

Gets a set containing all subscribed Permissibles to the given permission, by name.

Parameters
permissionPermission to query for
Returns
Set containing all subscribed permissions

Referenced by org.bukkit.command.Command.broadcastCommandMessage(), and org.bukkit.permissions.Permission.getPermissibles().

Plugin org.bukkit.plugin.PluginManager.getPlugin ( String  name)

Checks if the given plugin is loaded and returns it when applicable.

Please note that the name of the plugin is case-sensitive

Parameters
nameName of the plugin to check
Returns
Plugin if it exists, otherwise null

Referenced by org.bukkit.command.defaults.VersionCommand.execute(), and org.bukkit.WorldCreator.getGeneratorForName().

Plugin [] org.bukkit.plugin.PluginManager.getPlugins ( )
boolean org.bukkit.plugin.PluginManager.isPluginEnabled ( String  name)

Checks if the given plugin is enabled or not.

Please note that the name of the plugin is case-sensitive.

Parameters
nameName of the plugin to check
Returns
true if the plugin is enabled, otherwise false
boolean org.bukkit.plugin.PluginManager.isPluginEnabled ( Plugin  plugin)

Checks if the given plugin is enabled or not.

Parameters
pluginPlugin to check
Returns
true if the plugin is enabled, otherwise false
Plugin org.bukkit.plugin.PluginManager.loadPlugin ( File  file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException

Loads the plugin in the specified file.

File must be valid according to the current enabled Plugin interfaces

Parameters
fileFile containing the plugin to load
Returns
The Plugin loaded, or null if it was invalid
Exceptions
InvalidPluginExceptionThrown when the specified file is not a valid plugin
InvalidDescriptionExceptionThrown when the specified file contains an invalid description
UnknownDependencyExceptionIf a required dependency could not be resolved
Plugin [] org.bukkit.plugin.PluginManager.loadPlugins ( File  directory)

Loads the plugins contained within the specified directory.

Parameters
directoryDirectory to check for plugins
Returns
A list of all plugins loaded
void org.bukkit.plugin.PluginManager.recalculatePermissionDefaults ( Permission  perm)

Recalculates the defaults for the given Permission.

This will have no effect if the specified permission is not registered here.

Parameters
permPermission to recalculate

Referenced by org.bukkit.permissions.Permission.recalculatePermissibles().

void org.bukkit.plugin.PluginManager.registerEvent ( Class<?extends Event event,
Listener  listener,
EventPriority  priority,
EventExecutor  executor,
Plugin  plugin 
)

Registers the specified executor to the given event class.

Parameters
eventEvent type to register
listenerListener to register
priorityPriority to register this event at
executorEventExecutor to register
pluginPlugin to register
void org.bukkit.plugin.PluginManager.registerEvent ( Class<?extends Event event,
Listener  listener,
EventPriority  priority,
EventExecutor  executor,
Plugin  plugin,
boolean  ignoreCancelled 
)

Registers the specified executor to the given event class.

Parameters
eventEvent type to register
listenerListener to register
priorityPriority to register this event at
executorEventExecutor to register
pluginPlugin to register
ignoreCancelledWhether to pass cancelled events or not
void org.bukkit.plugin.PluginManager.registerEvents ( Listener  listener,
Plugin  plugin 
)

Registers all the events in the given listener class.

Parameters
listenerListener to register
pluginPlugin to register
void org.bukkit.plugin.PluginManager.registerInterface ( Class<?extends PluginLoader loader) throws IllegalArgumentException

Registers the specified plugin loader.

Parameters
loaderClass name of the PluginLoader to register
Exceptions
IllegalArgumentExceptionThrown when the given Class is not a valid PluginLoader
void org.bukkit.plugin.PluginManager.removePermission ( Permission  perm)

Removes a Permission registration from this plugin manager.

If the specified permission does not exist in this plugin manager, nothing will happen.

Removing a permission registration will not remove the permission from any Permissibles that have it.

Parameters
permPermission to remove
void org.bukkit.plugin.PluginManager.removePermission ( String  name)

Removes a Permission registration from this plugin manager.

If the specified permission does not exist in this plugin manager, nothing will happen.

Removing a permission registration will not remove the permission from any Permissibles that have it.

Parameters
namePermission to remove
void org.bukkit.plugin.PluginManager.subscribeToDefaultPerms ( boolean  op,
Permissible  permissible 
)

Subscribes to the given Default permissions by operator status.

If the specified defaults change in any form, the Permissible will be asked to recalculate.

Parameters
opDefault list to subscribe to
permissiblePermissible subscribing

Referenced by org.bukkit.permissions.PermissibleBase.recalculatePermissions().

void org.bukkit.plugin.PluginManager.subscribeToPermission ( String  permission,
Permissible  permissible 
)

Subscribes the given Permissible for information about the requested Permission, by name.

If the specified Permission changes in any form, the Permissible will be asked to recalculate.

Parameters
permissionPermission to subscribe to
permissiblePermissible subscribing

Referenced by org.bukkit.permissions.PermissibleBase.recalculatePermissions().

void org.bukkit.plugin.PluginManager.unsubscribeFromDefaultPerms ( boolean  op,
Permissible  permissible 
)

Unsubscribes from the given Default permissions by operator status.

Parameters
opDefault list to unsubscribe from
permissiblePermissible subscribing

Referenced by org.bukkit.permissions.PermissibleBase.clearPermissions().

void org.bukkit.plugin.PluginManager.unsubscribeFromPermission ( String  permission,
Permissible  permissible 
)

Unsubscribes the given Permissible for information about the requested Permission, by name.

Parameters
permissionPermission to unsubscribe from
permissiblePermissible subscribing

Referenced by org.bukkit.permissions.PermissibleBase.clearPermissions().

boolean org.bukkit.plugin.PluginManager.useTimings ( )

Returns whether or not timing code should be used for event calls.

Returns
True if event timings are to be used

Referenced by org.bukkit.plugin.java.JavaPluginLoader.createRegisteredListeners(), and org.bukkit.command.defaults.TimingsCommand.execute().


The documentation for this interface was generated from the following file: