|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.plugin.SimplePluginManager
public final class SimplePluginManager
Handles all plugin management from the Server
Constructor Summary | |
---|---|
SimplePluginManager(Server instance,
SimpleCommandMap commandMap)
|
Method Summary | |
---|---|
void |
addPermission(Permission perm)
Adds a Permission to this plugin manager. |
void |
callEvent(Event event)
Calls an event with the given details. This method only synchronizes when the event is not asynchronous. |
void |
clearPlugins()
Disables and removes all plugins |
void |
disablePlugin(Plugin plugin)
Disables the specified plugin Attempting to disable a plugin that is not enabled will have no effect |
void |
disablePlugins()
Disables all the loaded plugins |
void |
enablePlugin(Plugin plugin)
Enables the specified plugin Attempting to enable a plugin that is already enabled will have no effect |
Set<Permission> |
getDefaultPermissions(boolean op)
Gets the default permissions for the given op status |
Set<Permissible> |
getDefaultPermSubscriptions(boolean op)
Gets a set containing all subscribed Permissible s to the given default list, by op status |
Permission |
getPermission(String name)
Gets a Permission from its fully qualified name |
Set<Permission> |
getPermissions()
Gets a set of all registered permissions. |
Set<Permissible> |
getPermissionSubscriptions(String permission)
Gets a set containing all subscribed Permissible s to the given permission, by name |
Plugin |
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 |
Plugin[] |
getPlugins()
Gets a list of all currently loaded plugins |
boolean |
isPluginEnabled(Plugin plugin)
Checks if the given plugin is enabled or not |
boolean |
isPluginEnabled(String name)
Checks if the given plugin is enabled or not Please note that the name of the plugin is case-sensitive. |
Plugin |
loadPlugin(File file)
Loads the plugin in the specified file File must be valid according to the current enabled Plugin interfaces |
Plugin[] |
loadPlugins(File directory)
Loads the plugins contained within the specified directory |
void |
recalculatePermissionDefaults(Permission perm)
Recalculates the defaults for the given Permission . |
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 given event to the specified listener using a directly passed EventExecutor |
void |
registerEvents(Listener listener,
Plugin plugin)
Registers all the events in the given listener class |
void |
registerInterface(Class<? extends PluginLoader> loader)
Registers the specified plugin loader |
void |
removePermission(Permission perm)
Removes a Permission registration from this plugin manager. |
void |
removePermission(String name)
Removes a Permission registration from this plugin manager. |
void |
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. |
void |
subscribeToPermission(String permission,
Permissible permissible)
Subscribes the given Permissible for information about the requested Permission, by name. |
void |
unsubscribeFromDefaultPerms(boolean op,
Permissible permissible)
Unsubscribes from the given Default permissions by operator status |
void |
unsubscribeFromPermission(String permission,
Permissible permissible)
Unsubscribes the given Permissible for information about the requested Permission, by name. |
boolean |
useTimings()
Returns whether or not timing code should be used for event calls |
void |
useTimings(boolean use)
Sets whether or not per event timing code should be used |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimplePluginManager(Server instance, SimpleCommandMap commandMap)
Method Detail |
---|
public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException
registerInterface
in interface PluginManager
loader
- Class name of the PluginLoader to register
IllegalArgumentException
- Thrown when the given Class is not a valid PluginLoaderpublic Plugin[] loadPlugins(File directory)
loadPlugins
in interface PluginManager
directory
- Directory to check for plugins
public Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException
loadPlugin
in interface PluginManager
file
- File containing the plugin to load
InvalidPluginException
- Thrown when the specified file is not a valid plugin
UnknownDependencyException
- If a required dependency could not be foundpublic Plugin getPlugin(String name)
getPlugin
in interface PluginManager
name
- Name of the plugin to check
public Plugin[] getPlugins()
PluginManager
getPlugins
in interface PluginManager
public boolean isPluginEnabled(String name)
isPluginEnabled
in interface PluginManager
name
- Name of the plugin to check
public boolean isPluginEnabled(Plugin plugin)
isPluginEnabled
in interface PluginManager
plugin
- Plugin to check
public void enablePlugin(Plugin plugin)
PluginManager
enablePlugin
in interface PluginManager
plugin
- Plugin to enablepublic void disablePlugins()
PluginManager
disablePlugins
in interface PluginManager
public void disablePlugin(Plugin plugin)
PluginManager
disablePlugin
in interface PluginManager
plugin
- Plugin to disablepublic void clearPlugins()
PluginManager
clearPlugins
in interface PluginManager
public void callEvent(Event event)
callEvent
in interface PluginManager
event
- Event detailspublic void registerEvents(Listener listener, Plugin plugin)
PluginManager
registerEvents
in interface PluginManager
listener
- Listener to registerplugin
- Plugin to registerpublic void registerEvent(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin)
PluginManager
registerEvent
in interface PluginManager
event
- Event type to registerlistener
- Listener to registerpriority
- Priority to register this event atexecutor
- EventExecutor to registerplugin
- Plugin to registerpublic void registerEvent(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin, boolean ignoreCancelled)
registerEvent
in interface PluginManager
event
- Event class to registerlistener
- PlayerListener to registerpriority
- Priority of this eventexecutor
- EventExecutor to registerplugin
- Plugin to registerignoreCancelled
- Do not call executor if event was already cancelledpublic Permission getPermission(String name)
PluginManager
Permission
from its fully qualified name
getPermission
in interface PluginManager
name
- Name of the permission
public void addPermission(Permission perm)
PluginManager
Permission
to this plugin manager.
If a permission is already defined with the given name of the new permission,
an exception will be thrown.
addPermission
in interface PluginManager
perm
- Permission to addpublic Set<Permission> getDefaultPermissions(boolean op)
PluginManager
getDefaultPermissions
in interface PluginManager
op
- Which set of default permissions to get
public void removePermission(Permission perm)
PluginManager
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 Permissible
s that have it.
removePermission
in interface PluginManager
perm
- Permission to removepublic void removePermission(String name)
PluginManager
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 Permissible
s that have it.
removePermission
in interface PluginManager
name
- Permission to removepublic void recalculatePermissionDefaults(Permission perm)
PluginManager
Permission
.
This will have no effect if the specified permission is not registered here.
recalculatePermissionDefaults
in interface PluginManager
perm
- Permission to recalculatepublic void subscribeToPermission(String permission, Permissible permissible)
PluginManager
subscribeToPermission
in interface PluginManager
permission
- Permission to subscribe topermissible
- Permissible subscribingpublic void unsubscribeFromPermission(String permission, Permissible permissible)
PluginManager
unsubscribeFromPermission
in interface PluginManager
permission
- Permission to unsubscribe frompermissible
- Permissible subscribingpublic Set<Permissible> getPermissionSubscriptions(String permission)
PluginManager
Permissible
s to the given permission, by name
getPermissionSubscriptions
in interface PluginManager
permission
- Permission to query for
public void subscribeToDefaultPerms(boolean op, Permissible permissible)
PluginManager
subscribeToDefaultPerms
in interface PluginManager
op
- Default list to subscribe topermissible
- Permissible subscribingpublic void unsubscribeFromDefaultPerms(boolean op, Permissible permissible)
PluginManager
unsubscribeFromDefaultPerms
in interface PluginManager
op
- Default list to unsubscribe frompermissible
- Permissible subscribingpublic Set<Permissible> getDefaultPermSubscriptions(boolean op)
PluginManager
Permissible
s to the given default list, by op status
getDefaultPermSubscriptions
in interface PluginManager
op
- Default list to query for
public Set<Permission> getPermissions()
PluginManager
getPermissions
in interface PluginManager
public boolean useTimings()
PluginManager
useTimings
in interface PluginManager
public void useTimings(boolean use)
use
- True if per event timing code should be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |