类 SimplePluginManager

java.lang.Object
org.bukkit.plugin.SimplePluginManager
所有已实现的接口:
PluginManager

public final class SimplePluginManager extends Object implements PluginManager
Handles all plugin management from the Server
  • 构造器详细资料

  • 方法详细资料

    • registerInterface

      public void registerInterface(Class<? extends PluginLoader> loader) throws IllegalArgumentException
      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

      public Plugin[] loadPlugins(File directory)
      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 file

      File 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 plugin
      UnknownDependencyException - If a required dependency could not be found
    • getPlugin

      public 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

      指定者:
      getPlugin 在接口中 PluginManager
      参数:
      name - Name of the plugin to check
      返回:
      Plugin if it exists, otherwise null
    • getPlugins

      public Plugin[] getPlugins()
      从接口复制的说明: PluginManager
      获取所有已载入的插件对象.

      原文: Gets a list of all currently loaded plugins.

      指定者:
      getPlugins 在接口中 PluginManager
      返回:
      返回类型为Plugin的数组
    • isPluginEnabled

      public boolean isPluginEnabled(String name)
      Checks if the given plugin is enabled or not

      Please 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

      public boolean isPluginEnabled(Plugin plugin)
      Checks if the given plugin is enabled or not
      指定者:
      isPluginEnabled 在接口中 PluginManager
      参数:
      plugin - Plugin to check
      返回:
      true if the plugin is enabled, otherwise false
    • enablePlugin

      public void enablePlugin(Plugin plugin)
      从接口复制的说明: PluginManager
      Enables the specified plugin

      Attempting 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

      public void disablePlugin(Plugin plugin)
      从接口复制的说明: PluginManager
      Disables the specified plugin

      Attempting 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

      public void callEvent(Event event)
      Calls an event with the given details.

      This method only synchronizes when the event is not asynchronous.

      指定者:
      callEvent 在接口中 PluginManager
      参数:
      event - Event details
    • registerEvents

      public void registerEvents(Listener listener, Plugin plugin)
      从接口复制的说明: PluginManager
      Registers all the events in the given listener class
      指定者:
      registerEvents 在接口中 PluginManager
      参数:
      listener - Listener to register
      plugin - 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 register
      listener - Listener to register
      priority - Priority to register this event at
      executor - EventExecutor to register
      plugin - 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 register
      listener - PlayerListener to register
      priority - Priority of this event
      executor - EventExecutor to register
      plugin - Plugin to register
      ignoreCancelled - Do not call executor if event was already cancelled
    • getPermission

      public Permission getPermission(String name)
      从接口复制的说明: PluginManager
      Gets a Permission from its fully qualified name
      指定者:
      getPermission 在接口中 PluginManager
      参数:
      name - Name of the permission
      返回:
      Permission, or null if none
    • addPermission

      public void addPermission(Permission perm)
      从接口复制的说明: PluginManager
      Adds a 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
    • addPermission

      @Deprecated public void addPermission(Permission perm, boolean dirty)
      已过时。
    • getDefaultPermissions

      public Set<Permission> getDefaultPermissions(boolean op)
      从接口复制的说明: PluginManager
      获取普通玩家默认拥有的权限或op默认拥有的权限.

      原文: Gets the default permissions for the given op status

      指定者:
      getDefaultPermissions 在接口中 PluginManager
      返回:
      返回 普通玩家/OP 默认拥有的权限
    • removePermission

      public void removePermission(Permission perm)
      从接口复制的说明: PluginManager
      Removes a 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 Permissibles that have it.

      指定者:
      removePermission 在接口中 PluginManager
      参数:
      perm - Permission to remove
    • removePermission

      public void removePermission(String name)
      从接口复制的说明: PluginManager
      Removes a 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 Permissibles that have it.

      指定者:
      removePermission 在接口中 PluginManager
      参数:
      name - Permission to remove
    • recalculatePermissionDefaults

      public void recalculatePermissionDefaults(Permission perm)
      从接口复制的说明: PluginManager
      Recalculates the defaults for the given Permission.

      This will have no effect if the specified permission is not registered here.

      指定者:
      recalculatePermissionDefaults 在接口中 PluginManager
      参数:
      perm - Permission to recalculate
    • dirtyPermissibles

      @Deprecated public void dirtyPermissibles()
      已过时。
    • subscribeToPermission

      public void subscribeToPermission(String permission, Permissible permissible)
      从接口复制的说明: 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 to
      permissible - Permissible subscribing
    • unsubscribeFromPermission

      public void unsubscribeFromPermission(String permission, Permissible permissible)
      从接口复制的说明: PluginManager
      Unsubscribes the given Permissible for information about the requested Permission, by name.
      指定者:
      unsubscribeFromPermission 在接口中 PluginManager
      参数:
      permission - Permission to unsubscribe from
      permissible - Permissible subscribing
    • getPermissionSubscriptions

      public Set<Permissible> getPermissionSubscriptions(String permission)
      从接口复制的说明: PluginManager
      Gets a set containing all subscribed Permissibles to the given permission, by name
      指定者:
      getPermissionSubscriptions 在接口中 PluginManager
      参数:
      permission - Permission to query for
      返回:
      Set containing all subscribed permissions
    • subscribeToDefaultPerms

      public void subscribeToDefaultPerms(boolean op, Permissible permissible)
      从接口复制的说明: PluginManager
      Subscribes to the given Default permissions by operator status

      If the specified defaults change in any form, the Permissible will be asked to recalculate.

      指定者:
      subscribeToDefaultPerms 在接口中 PluginManager
      参数:
      op - Default list to subscribe to
      permissible - Permissible subscribing
    • unsubscribeFromDefaultPerms

      public void unsubscribeFromDefaultPerms(boolean op, Permissible permissible)
      从接口复制的说明: PluginManager
      Unsubscribes from the given Default permissions by operator status
      指定者:
      unsubscribeFromDefaultPerms 在接口中 PluginManager
      参数:
      op - Default list to unsubscribe from
      permissible - Permissible subscribing
    • getDefaultPermSubscriptions

      public Set<Permissible> getDefaultPermSubscriptions(boolean op)
      从接口复制的说明: PluginManager
      Gets a set containing all subscribed Permissibles to the given default list, by op status
      指定者:
      getDefaultPermSubscriptions 在接口中 PluginManager
      参数:
      op - Default list to query for
      返回:
      Set containing all subscribed permissions
    • getPermissions

      public Set<Permission> 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