类 SimplePluginManager
- 所有已实现的接口:
PluginManager
-
构造器概要
-
方法概要
修饰符和类型方法说明void
addPermission
(Permission perm) Adds aPermission
to this plugin manager.void
addPermission
(Permission perm, boolean dirty) 已过时。void
Calls an event with the given details.void
停用并清除所有已启用插件的Plugin对象.void
已过时。void
disablePlugin
(Plugin plugin) Disables the specified pluginvoid
停用所有已载入的插件.void
enablePlugin
(Plugin plugin) Enables the specified plugingetDefaultPermissions
(boolean op) 获取普通玩家默认拥有的权限或op默认拥有的权限.getDefaultPermSubscriptions
(boolean op) Gets a set containing all subscribedPermissible
s to the given default list, by op statusgetPermission
(String name) Gets aPermission
from its fully qualified nameGets a set of all registered permissions.getPermissionSubscriptions
(String permission) Gets a set containing all subscribedPermissible
s to the given permission, by nameChecks if the given plugin is loaded and returns it when applicablePlugin[]
获取所有已载入的插件对象.boolean
isPluginEnabled
(String name) Checks if the given plugin is enabled or notboolean
isPluginEnabled
(Plugin plugin) Checks if the given plugin is enabled or notloadPlugin
(File file) Loads the plugin in the specified filePlugin[]
loadPlugins
(File directory) Loads the plugins contained within the specified directoryvoid
Recalculates the defaults for the givenPermission
.void
registerEvent
(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin) Registers the specified executor to the given event classvoid
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 EventExecutorvoid
registerEvents
(Listener listener, Plugin plugin) Registers all the events in the given listener classvoid
registerInterface
(Class<? extends PluginLoader> loader) Registers the specified plugin loadervoid
removePermission
(String name) Removes aPermission
registration from this plugin manager.void
removePermission
(Permission perm) Removes aPermission
registration from this plugin manager.void
subscribeToDefaultPerms
(boolean op, Permissible permissible) Subscribes to the given Default permissions by operator statusvoid
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 statusvoid
unsubscribeFromPermission
(String permission, Permissible permissible) Unsubscribes the given Permissible for information about the requested Permission, by name.boolean
Returns whether or not timing code should be used for event callsvoid
useTimings
(boolean use) Sets whether or not per event timing code should be used
-
构造器详细资料
-
SimplePluginManager
-
-
方法详细资料
-
registerInterface
Registers the specified plugin loader- 指定者:
registerInterface
在接口中PluginManager
- 参数:
loader
- Class name of the PluginLoader to register- 抛出:
IllegalArgumentException
- Thrown when the given Class is not a valid PluginLoader
-
loadPlugins
Loads the plugins contained within the specified directory- 指定者:
loadPlugins
在接口中PluginManager
- 参数:
directory
- Directory to check for plugins- 返回:
- A list of all plugins loaded
-
loadPlugin
Loads the plugin in the specified fileFile must be valid according to the current enabled Plugin interfaces
- 指定者:
loadPlugin
在接口中PluginManager
- 参数:
file
- File containing the plugin to load- 返回:
- The Plugin loaded, or null if it was invalid
- 抛出:
InvalidPluginException
- Thrown when the specified file is not a valid pluginUnknownDependencyException
- If a required dependency could not be found
-
getPlugin
Checks if the given plugin is loaded and returns it when applicablePlease note that the name of the plugin is case-sensitive
- 指定者:
getPlugin
在接口中PluginManager
- 参数:
name
- Name of the plugin to check- 返回:
- Plugin if it exists, otherwise null
-
getPlugins
从接口复制的说明:PluginManager
获取所有已载入的插件对象. 原文: Gets a list of all currently loaded plugins.- 指定者:
getPlugins
在接口中PluginManager
- 返回:
- 返回类型为Plugin的数组
-
isPluginEnabled
Checks if the given plugin is enabled or notPlease note that the name of the plugin is case-sensitive.
- 指定者:
isPluginEnabled
在接口中PluginManager
- 参数:
name
- Name of the plugin to check- 返回:
- true if the plugin is enabled, otherwise false
-
isPluginEnabled
Checks if the given plugin is enabled or not- 指定者:
isPluginEnabled
在接口中PluginManager
- 参数:
plugin
- Plugin to check- 返回:
- true if the plugin is enabled, otherwise false
-
enablePlugin
从接口复制的说明:PluginManager
Enables the specified pluginAttempting to enable a plugin that is already enabled will have no effect
- 指定者:
enablePlugin
在接口中PluginManager
- 参数:
plugin
- Plugin to enable
-
disablePlugins
public void disablePlugins()从接口复制的说明:PluginManager
停用所有已载入的插件. 原文: Disables all the loaded plugins.- 指定者:
disablePlugins
在接口中PluginManager
-
disablePlugin
从接口复制的说明:PluginManager
Disables the specified pluginAttempting to disable a plugin that is not enabled will have no effect
- 指定者:
disablePlugin
在接口中PluginManager
- 参数:
plugin
- Plugin to disable
-
clearPlugins
public void clearPlugins()从接口复制的说明:PluginManager
停用并清除所有已启用插件的Plugin对象. 原文: Disables and removes all plugins.- 指定者:
clearPlugins
在接口中PluginManager
-
callEvent
Calls an event with the given details.This method only synchronizes when the event is not asynchronous.
- 指定者:
callEvent
在接口中PluginManager
- 参数:
event
- Event details
-
registerEvents
从接口复制的说明:PluginManager
Registers all the events in the given listener class- 指定者:
registerEvents
在接口中PluginManager
- 参数:
listener
- Listener to registerplugin
- Plugin to register
-
registerEvent
public void registerEvent(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin) 从接口复制的说明:PluginManager
Registers the specified executor to the given event class- 指定者:
registerEvent
在接口中PluginManager
- 参数:
event
- Event type to registerlistener
- Listener to registerpriority
- Priority to register this event atexecutor
- EventExecutor to registerplugin
- Plugin to register
-
registerEvent
public 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- 指定者:
registerEvent
在接口中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 cancelled
-
getPermission
从接口复制的说明:PluginManager
Gets aPermission
from its fully qualified name- 指定者:
getPermission
在接口中PluginManager
- 参数:
name
- Name of the permission- 返回:
- Permission, or null if none
-
addPermission
从接口复制的说明:PluginManager
Adds aPermission
to this plugin manager.If a permission is already defined with the given name of the new permission, an exception will be thrown.
- 指定者:
addPermission
在接口中PluginManager
- 参数:
perm
- Permission to add
-
addPermission
已过时。 -
getDefaultPermissions
从接口复制的说明:PluginManager
获取普通玩家默认拥有的权限或op默认拥有的权限. 原文: Gets the default permissions for the given op status- 指定者:
getDefaultPermissions
在接口中PluginManager
- 返回:
- 返回 普通玩家/OP 默认拥有的权限
-
removePermission
从接口复制的说明:PluginManager
Removes aPermission
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
在接口中PluginManager
- 参数:
perm
- Permission to remove
-
removePermission
从接口复制的说明:PluginManager
Removes aPermission
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
在接口中PluginManager
- 参数:
name
- Permission to remove
-
recalculatePermissionDefaults
从接口复制的说明:PluginManager
Recalculates the defaults for the givenPermission
.This will have no effect if the specified permission is not registered here.
- 指定者:
recalculatePermissionDefaults
在接口中PluginManager
- 参数:
perm
- Permission to recalculate
-
dirtyPermissibles
已过时。 -
subscribeToPermission
从接口复制的说明:PluginManager
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.
- 指定者:
subscribeToPermission
在接口中PluginManager
- 参数:
permission
- Permission to subscribe topermissible
- Permissible subscribing
-
unsubscribeFromPermission
从接口复制的说明:PluginManager
Unsubscribes the given Permissible for information about the requested Permission, by name.- 指定者:
unsubscribeFromPermission
在接口中PluginManager
- 参数:
permission
- Permission to unsubscribe frompermissible
- Permissible subscribing
-
getPermissionSubscriptions
从接口复制的说明:PluginManager
Gets a set containing all subscribedPermissible
s to the given permission, by name- 指定者:
getPermissionSubscriptions
在接口中PluginManager
- 参数:
permission
- Permission to query for- 返回:
- Set containing all subscribed permissions
-
subscribeToDefaultPerms
从接口复制的说明:PluginManager
Subscribes to the given Default permissions by operator statusIf the specified defaults change in any form, the Permissible will be asked to recalculate.
- 指定者:
subscribeToDefaultPerms
在接口中PluginManager
- 参数:
op
- Default list to subscribe topermissible
- Permissible subscribing
-
unsubscribeFromDefaultPerms
从接口复制的说明:PluginManager
Unsubscribes from the given Default permissions by operator status- 指定者:
unsubscribeFromDefaultPerms
在接口中PluginManager
- 参数:
op
- Default list to unsubscribe frompermissible
- Permissible subscribing
-
getDefaultPermSubscriptions
从接口复制的说明:PluginManager
Gets a set containing all subscribedPermissible
s to the given default list, by op status- 指定者:
getDefaultPermSubscriptions
在接口中PluginManager
- 参数:
op
- Default list to query for- 返回:
- Set containing all subscribed permissions
-
getPermissions
从接口复制的说明:PluginManager
Gets a set of all registered permissions.This set is a copy and will not be modified live.
- 指定者:
getPermissions
在接口中PluginManager
- 返回:
- Set containing all current registered permissions
-
useTimings
public boolean useTimings()从接口复制的说明:PluginManager
Returns whether or not timing code should be used for event calls- 指定者:
useTimings
在接口中PluginManager
- 返回:
- True if event timings are to be used
-
useTimings
public void useTimings(boolean use) Sets whether or not per event timing code should be used- 参数:
use
- True if per event timing code should be used
-