public final class SimplePluginManager extends Object implements PluginManager
| コンストラクタと説明 |
|---|
SimplePluginManager(Server instance,
SimpleCommandMap commandMap) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addPermission(Permission perm)
Adds a
Permission to this plugin manager. |
void |
callEvent(Event event)
Calls an event with the given details.
|
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
Permissibles 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
Permissibles 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
|
public SimplePluginManager(Server instance, SimpleCommandMap commandMap)
public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException
registerInterface インタフェース内 PluginManagerloader - Class name of the PluginLoader to registerIllegalArgumentException - Thrown when the given Class is not a
valid PluginLoaderpublic Plugin[] loadPlugins(File directory)
loadPlugins インタフェース内 PluginManagerdirectory - Directory to check for pluginspublic Plugin loadPlugin(File file) throws InvalidPluginException, UnknownDependencyException
File must be valid according to the current enabled Plugin interfaces
loadPlugin インタフェース内 PluginManagerfile - File containing the plugin to loadInvalidPluginException - Thrown when the specified file is not a
valid pluginUnknownDependencyException - If a required dependency could not
be foundpublic Plugin getPlugin(String name)
Please note that the name of the plugin is case-sensitive
getPlugin インタフェース内 PluginManagername - Name of the plugin to checkpublic Plugin[] getPlugins()
PluginManagergetPlugins インタフェース内 PluginManagerpublic boolean isPluginEnabled(String name)
Please note that the name of the plugin is case-sensitive.
isPluginEnabled インタフェース内 PluginManagername - Name of the plugin to checkpublic boolean isPluginEnabled(Plugin plugin)
isPluginEnabled インタフェース内 PluginManagerplugin - Plugin to checkpublic void enablePlugin(Plugin plugin)
PluginManagerAttempting to enable a plugin that is already enabled will have no effect
enablePlugin インタフェース内 PluginManagerplugin - Plugin to enablepublic void disablePlugins()
PluginManagerdisablePlugins インタフェース内 PluginManagerpublic void disablePlugin(Plugin plugin)
PluginManagerAttempting to disable a plugin that is not enabled will have no effect
disablePlugin インタフェース内 PluginManagerplugin - Plugin to disablepublic void clearPlugins()
PluginManagerclearPlugins インタフェース内 PluginManagerpublic void callEvent(Event event)
This method only synchronizes when the event is not asynchronous.
callEvent インタフェース内 PluginManagerevent - Event detailspublic void registerEvents(Listener listener, Plugin plugin)
PluginManagerregisterEvents インタフェース内 PluginManagerlistener - Listener to registerplugin - Plugin to registerpublic void registerEvent(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin)
PluginManagerregisterEvent インタフェース内 PluginManagerevent - 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 インタフェース内 PluginManagerevent - 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)
PluginManagerPermission from its fully qualified namegetPermission インタフェース内 PluginManagername - Name of the permissionpublic void addPermission(Permission perm)
PluginManagerPermission to this plugin manager.
If a permission is already defined with the given name of the new permission, an exception will be thrown.
addPermission インタフェース内 PluginManagerperm - Permission to addpublic Set<Permission> getDefaultPermissions(boolean op)
PluginManagergetDefaultPermissions インタフェース内 PluginManagerop - Which set of default permissions to getpublic void removePermission(Permission perm)
PluginManagerPermission 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.
removePermission インタフェース内 PluginManagerperm - Permission to removepublic void removePermission(String name)
PluginManagerPermission 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.
removePermission インタフェース内 PluginManagername - Permission to removepublic void recalculatePermissionDefaults(Permission perm)
PluginManagerPermission.
This will have no effect if the specified permission is not registered here.
recalculatePermissionDefaults インタフェース内 PluginManagerperm - Permission to recalculatepublic void subscribeToPermission(String permission, Permissible permissible)
PluginManagerIf the specified Permission changes in any form, the Permissible will be asked to recalculate.
subscribeToPermission インタフェース内 PluginManagerpermission - Permission to subscribe topermissible - Permissible subscribingpublic void unsubscribeFromPermission(String permission, Permissible permissible)
PluginManagerunsubscribeFromPermission インタフェース内 PluginManagerpermission - Permission to unsubscribe frompermissible - Permissible subscribingpublic Set<Permissible> getPermissionSubscriptions(String permission)
PluginManagerPermissibles to the given
permission, by namegetPermissionSubscriptions インタフェース内 PluginManagerpermission - Permission to query forpublic void subscribeToDefaultPerms(boolean op,
Permissible permissible)
PluginManagerIf the specified defaults change in any form, the Permissible will be asked to recalculate.
subscribeToDefaultPerms インタフェース内 PluginManagerop - Default list to subscribe topermissible - Permissible subscribingpublic void unsubscribeFromDefaultPerms(boolean op,
Permissible permissible)
PluginManagerunsubscribeFromDefaultPerms インタフェース内 PluginManagerop - Default list to unsubscribe frompermissible - Permissible subscribingpublic Set<Permissible> getDefaultPermSubscriptions(boolean op)
PluginManagerPermissibles to the given
default list, by op statusgetDefaultPermSubscriptions インタフェース内 PluginManagerop - Default list to query forpublic Set<Permission> getPermissions()
PluginManagerThis set is a copy and will not be modified live.
getPermissions インタフェース内 PluginManagerpublic boolean useTimings()
PluginManageruseTimings インタフェース内 PluginManagerpublic void useTimings(boolean use)
use - True if per event timing code should be usedCopyright © 2016. All rights reserved.