类 SimplePluginManager
- 所有已实现的接口:
PluginManager
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidaddPermission(Permission perm) Adds aPermissionto this plugin manager.voidaddPermission(Permission perm, boolean dirty) 已过时。voidCalls an event with the given details.void停用并清除所有已启用插件的Plugin对象.void已过时。voiddisablePlugin(Plugin plugin) Disables the specified pluginvoid停用所有已载入的插件.voidenablePlugin(Plugin plugin) Enables the specified plugingetDefaultPermissions(boolean op) 获取普通玩家默认拥有的权限或op默认拥有的权限.getDefaultPermSubscriptions(boolean op) Gets a set containing all subscribedPermissibles to the given default list, by op statusgetPermission(String name) Gets aPermissionfrom its fully qualified nameGets a set of all registered permissions.getPermissionSubscriptions(String permission) Gets a set containing all subscribedPermissibles to the given permission, by nameChecks if the given plugin is loaded and returns it when applicablePlugin[]获取所有已载入的插件对象.booleanisPluginEnabled(String name) Checks if the given plugin is enabled or notbooleanisPluginEnabled(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 directoryvoidRecalculates the defaults for the givenPermission.voidregisterEvent(Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin) Registers the specified executor to the given event classvoidregisterEvent(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 EventExecutorvoidregisterEvents(Listener listener, Plugin plugin) Registers all the events in the given listener classvoidregisterInterface(Class<? extends PluginLoader> loader) Registers the specified plugin loadervoidremovePermission(String name) Removes aPermissionregistration from this plugin manager.voidremovePermission(Permission perm) Removes aPermissionregistration from this plugin manager.voidsubscribeToDefaultPerms(boolean op, Permissible permissible) Subscribes to the given Default permissions by operator statusvoidsubscribeToPermission(String permission, Permissible permissible) Subscribes the given Permissible for information about the requested Permission, by name.voidunsubscribeFromDefaultPerms(boolean op, Permissible permissible) Unsubscribes from the given Default permissions by operator statusvoidunsubscribeFromPermission(String permission, Permissible permissible) Unsubscribes the given Permissible for information about the requested Permission, by name.booleanReturns whether or not timing code should be used for event callsvoiduseTimings(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
从接口复制的说明:PluginManagerEnables 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
从接口复制的说明:PluginManagerDisables 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
从接口复制的说明:PluginManagerRegisters 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) 从接口复制的说明:PluginManagerRegisters 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
从接口复制的说明:PluginManagerGets aPermissionfrom its fully qualified name- 指定者:
getPermission在接口中PluginManager- 参数:
name- Name of the permission- 返回:
- Permission, or null if none
-
addPermission
从接口复制的说明:PluginManagerAdds aPermissionto 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
从接口复制的说明:PluginManagerRemoves aPermissionregistration 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在接口中PluginManager- 参数:
perm- Permission to remove
-
removePermission
从接口复制的说明:PluginManagerRemoves aPermissionregistration 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在接口中PluginManager- 参数:
name- Permission to remove
-
recalculatePermissionDefaults
从接口复制的说明:PluginManagerRecalculates 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
从接口复制的说明:PluginManagerSubscribes 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
从接口复制的说明:PluginManagerUnsubscribes the given Permissible for information about the requested Permission, by name.- 指定者:
unsubscribeFromPermission在接口中PluginManager- 参数:
permission- Permission to unsubscribe frompermissible- Permissible subscribing
-
getPermissionSubscriptions
从接口复制的说明:PluginManagerGets a set containing all subscribedPermissibles to the given permission, by name- 指定者:
getPermissionSubscriptions在接口中PluginManager- 参数:
permission- Permission to query for- 返回:
- Set containing all subscribed permissions
-
subscribeToDefaultPerms
从接口复制的说明:PluginManagerSubscribes 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
从接口复制的说明:PluginManagerUnsubscribes from the given Default permissions by operator status- 指定者:
unsubscribeFromDefaultPerms在接口中PluginManager- 参数:
op- Default list to unsubscribe frompermissible- Permissible subscribing
-
getDefaultPermSubscriptions
从接口复制的说明:PluginManagerGets a set containing all subscribedPermissibles to the given default list, by op status- 指定者:
getDefaultPermSubscriptions在接口中PluginManager- 参数:
op- Default list to query for- 返回:
- Set containing all subscribed permissions
-
getPermissions
从接口复制的说明:PluginManagerGets 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()从接口复制的说明:PluginManagerReturns 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
-