public final class SimplePluginManager extends java.lang.Object implements PluginManager
构造器和说明 |
---|
SimplePluginManager(Server instance,
SimpleCommandMap commandMap) |
限定符和类型 | 方法和说明 |
---|---|
void |
addPermission(Permission perm)
Adds a
Permission to this plugin manager. |
void |
addPermission(Permission perm,
boolean dirty)
已过时。
|
void |
callEvent(Event event)
Calls an event with the given details.
|
void |
clearPlugins()
停用并清除所有已启用插件的Plugin对象.
|
void |
dirtyPermissibles()
已过时。
|
void |
disablePlugin(Plugin plugin)
Disables the specified plugin
Attempting to disable a plugin that is not enabled will have no effect
|
void |
disablePlugins()
停用所有已载入的插件.
|
void |
enablePlugin(Plugin plugin)
Enables the specified plugin
Attempting to enable a plugin that is already enabled will have no
effect
|
java.util.Set<Permission> |
getDefaultPermissions(boolean op)
获取普通玩家默认拥有的权限或op默认拥有的权限.
|
java.util.Set<Permissible> |
getDefaultPermSubscriptions(boolean op)
Gets a set containing all subscribed
Permissible s to the given
default list, by op status |
Permission |
getPermission(java.lang.String name)
Gets a
Permission from its fully qualified name |
java.util.Set<Permission> |
getPermissions()
Gets a set of all registered permissions.
|
java.util.Set<Permissible> |
getPermissionSubscriptions(java.lang.String permission)
Gets a set containing all subscribed
Permissible s to the given
permission, by name |
Plugin |
getPlugin(java.lang.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()
获取所有已载入的插件对象.
|
boolean |
isPluginEnabled(Plugin plugin)
Checks if the given plugin is enabled or not
|
boolean |
isPluginEnabled(java.lang.String name)
Checks if the given plugin is enabled or not
Please note that the name of the plugin is case-sensitive.
|
Plugin |
loadPlugin(java.io.File file)
Loads the plugin in the specified file
File must be valid according to the current enabled Plugin interfaces
|
Plugin[] |
loadPlugins(java.io.File directory)
Loads the plugins contained within the specified directory
|
void |
recalculatePermissionDefaults(Permission perm)
Recalculates the defaults for the given
Permission . |
void |
registerEvent(java.lang.Class<? extends Event> event,
Listener listener,
EventPriority priority,
EventExecutor executor,
Plugin plugin)
Registers the specified executor to the given event class
|
void |
registerEvent(java.lang.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(java.lang.Class<? extends PluginLoader> loader)
Registers the specified plugin loader
|
void |
removePermission(Permission perm)
Removes a
Permission registration from this plugin manager. |
void |
removePermission(java.lang.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(java.lang.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(java.lang.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(java.lang.Class<? extends PluginLoader> loader) throws java.lang.IllegalArgumentException
registerInterface
在接口中 PluginManager
loader
- Class name of the PluginLoader to registerjava.lang.IllegalArgumentException
- Thrown when the given Class is not a
valid PluginLoaderpublic Plugin[] loadPlugins(java.io.File directory)
loadPlugins
在接口中 PluginManager
directory
- Directory to check for pluginspublic Plugin loadPlugin(java.io.File file) throws InvalidPluginException, UnknownDependencyException
File must be valid according to the current enabled Plugin interfaces
loadPlugin
在接口中 PluginManager
file
- 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(java.lang.String name)
Please note that the name of the plugin is case-sensitive
getPlugin
在接口中 PluginManager
name
- Name of the plugin to checkpublic Plugin[] getPlugins()
PluginManager
getPlugins
在接口中 PluginManager
public boolean isPluginEnabled(java.lang.String name)
Please note that the name of the plugin is case-sensitive.
isPluginEnabled
在接口中 PluginManager
name
- Name of the plugin to checkpublic boolean isPluginEnabled(Plugin plugin)
isPluginEnabled
在接口中 PluginManager
plugin
- Plugin to checkpublic void enablePlugin(Plugin plugin)
PluginManager
Attempting to enable a plugin that is already enabled will have no effect
enablePlugin
在接口中 PluginManager
plugin
- Plugin to enablepublic void disablePlugins()
PluginManager
disablePlugins
在接口中 PluginManager
public void disablePlugin(Plugin plugin)
PluginManager
Attempting to disable a plugin that is not enabled will have no effect
disablePlugin
在接口中 PluginManager
plugin
- Plugin to disablepublic void clearPlugins()
PluginManager
clearPlugins
在接口中 PluginManager
public void callEvent(Event event)
This method only synchronizes when the event is not asynchronous.
callEvent
在接口中 PluginManager
event
- Event detailspublic void registerEvents(Listener listener, Plugin plugin)
PluginManager
registerEvents
在接口中 PluginManager
listener
- Listener to registerplugin
- Plugin to registerpublic void registerEvent(java.lang.Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin)
PluginManager
registerEvent
在接口中 PluginManager
event
- Event type to registerlistener
- Listener to registerpriority
- Priority to register this event atexecutor
- EventExecutor to registerplugin
- Plugin to registerpublic void registerEvent(java.lang.Class<? extends Event> event, Listener listener, EventPriority priority, EventExecutor executor, Plugin plugin, boolean ignoreCancelled)
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
cancelledpublic Permission getPermission(java.lang.String name)
PluginManager
Permission
from its fully qualified namegetPermission
在接口中 PluginManager
name
- Name of the permissionpublic 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
在接口中 PluginManager
perm
- Permission to add@Deprecated public void addPermission(Permission perm, boolean dirty)
public java.util.Set<Permission> getDefaultPermissions(boolean op)
PluginManager
getDefaultPermissions
在接口中 PluginManager
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
在接口中 PluginManager
perm
- Permission to removepublic void removePermission(java.lang.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
在接口中 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
在接口中 PluginManager
perm
- Permission to recalculate@Deprecated public void dirtyPermissibles()
public void subscribeToPermission(java.lang.String permission, Permissible permissible)
PluginManager
If the specified Permission changes in any form, the Permissible will be asked to recalculate.
subscribeToPermission
在接口中 PluginManager
permission
- Permission to subscribe topermissible
- Permissible subscribingpublic void unsubscribeFromPermission(java.lang.String permission, Permissible permissible)
PluginManager
unsubscribeFromPermission
在接口中 PluginManager
permission
- Permission to unsubscribe frompermissible
- Permissible subscribingpublic java.util.Set<Permissible> getPermissionSubscriptions(java.lang.String permission)
PluginManager
Permissible
s to the given
permission, by namegetPermissionSubscriptions
在接口中 PluginManager
permission
- Permission to query forpublic void subscribeToDefaultPerms(boolean op, Permissible permissible)
PluginManager
If the specified defaults change in any form, the Permissible will be asked to recalculate.
subscribeToDefaultPerms
在接口中 PluginManager
op
- Default list to subscribe topermissible
- Permissible subscribingpublic void unsubscribeFromDefaultPerms(boolean op, Permissible permissible)
PluginManager
unsubscribeFromDefaultPerms
在接口中 PluginManager
op
- Default list to unsubscribe frompermissible
- Permissible subscribingpublic java.util.Set<Permissible> getDefaultPermSubscriptions(boolean op)
PluginManager
Permissible
s to the given
default list, by op statusgetDefaultPermSubscriptions
在接口中 PluginManager
op
- Default list to query forpublic java.util.Set<Permission> getPermissions()
PluginManager
This set is a copy and will not be modified live.
getPermissions
在接口中 PluginManager
public boolean useTimings()
PluginManager
useTimings
在接口中 PluginManager
public void useTimings(boolean use)
use
- True if per event timing code should be used