Interface PluginManager
- All Superinterfaces:
- PermissionManager
- All Known Implementing Classes:
- SimplePluginManager
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPermission(@NotNull Permission perm) Adds aPermissionto this plugin manager.voidCalls an event with the given detailsvoidDisables and removes all pluginsvoiddisablePlugin(@NotNull Plugin plugin) Disables the specified pluginvoidDisables all the loaded pluginsvoidenablePlugin(@NotNull Plugin plugin) Enables the specified plugingetDefaultPermissions(boolean op) Gets the default permissions for the given op statusgetDefaultPermSubscriptions(boolean op) Gets a set containing all subscribedPermissibles to the given default list, by op statusgetPermission(@NotNull String name) Gets aPermissionfrom its fully qualified nameGets a set of all registered permissions.getPermissionSubscriptions(@NotNull String permission) Gets a set containing all subscribedPermissibles to the given permission, by nameChecks if the given plugin is loaded and returns it when applicableGets a list of all currently loaded pluginsbooleanisPluginEnabled(@NotNull String name) Checks if the given plugin is enabled or notbooleanisPluginEnabled(@Nullable Plugin plugin) Checks if the given plugin is enabled or notbooleanisTransitiveDependency(PluginMeta pluginMeta, PluginMeta dependencyConfig) loadPlugin(@NotNull File file) Loads the plugin in the specified fileloadPlugins(@NotNull File directory) Loads the plugins contained within the specified directoryvoidoverridePermissionManager(@NotNull Plugin plugin, PermissionManager permissionManager) Sets the permission manager to be used for this server.voidRecalculates the defaults for the givenPermission.voidregisterEvent(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin) Registers the specified executor to the given event classvoidregisterEvent(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin, boolean ignoreCancelled) Registers the specified executor to the given event classvoidregisterEvents(@NotNull Listener listener, @NotNull Plugin plugin) Registers all the events in the given listener classvoidregisterInterface(@NotNull Class<? extends PluginLoader> loader) Deprecated, for removal: This API element is subject to removal in a future version.voidremovePermission(@NotNull String name) Removes aPermissionregistration from this plugin manager.voidRemoves aPermissionregistration from this plugin manager.voidsubscribeToDefaultPerms(boolean op, @NotNull Permissible permissible) Subscribes to the given Default permissions by operator statusvoidsubscribeToPermission(@NotNull String permission, @NotNull Permissible permissible) Subscribes the given Permissible for information about the requested Permission, by name.voidunsubscribeFromDefaultPerms(boolean op, @NotNull Permissible permissible) Unsubscribes from the given Default permissions by operator statusvoidunsubscribeFromPermission(@NotNull String permission, @NotNull 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 callsMethods inherited from interface io.papermc.paper.plugin.PermissionManageraddPermissions, clearPermissions
- 
Method Details- 
registerInterface@Deprecated(forRemoval=true) void registerInterface(@NotNull @NotNull Class<? extends PluginLoader> loader) throws IllegalArgumentException Deprecated, for removal: This API element is subject to removal in a future version.Registers the specified plugin loader- Parameters:
- loader- Class name of the PluginLoader to register
- Throws:
- IllegalArgumentException- Thrown when the given Class is not a valid PluginLoader
 
- 
getPluginChecks if the given plugin is loaded and returns it when applicablePlease note that the name of the plugin is case-sensitive - Parameters:
- name- Name of the plugin to check
- Returns:
- Plugin if it exists, otherwise null
 
- 
getPluginsGets a list of all currently loaded plugins- Returns:
- Array of Plugins
 
- 
isPluginEnabledChecks if the given plugin is enabled or notPlease note that the name of the plugin is case-sensitive. - Parameters:
- name- Name of the plugin to check
- Returns:
- true if the plugin is enabled, otherwise false
 
- 
isPluginEnabledChecks if the given plugin is enabled or not- Parameters:
- plugin- Plugin to check
- Returns:
- true if the plugin is enabled, otherwise false
 
- 
loadPlugin@Nullable @Nullable Plugin loadPlugin(@NotNull @NotNull File file) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException Loads the plugin in the specified fileFile must be valid according to the current enabled Plugin interfaces - Parameters:
- file- File containing the plugin to load
- Returns:
- The Plugin loaded, or null if it was invalid
- Throws:
- InvalidPluginException- Thrown when the specified file is not a valid plugin
- InvalidDescriptionException- Thrown when the specified file contains an invalid description
- UnknownDependencyException- If a required dependency could not be resolved
 
- 
loadPluginsLoads the plugins contained within the specified directory- Parameters:
- directory- Directory to check for plugins
- Returns:
- A list of all plugins loaded
 
- 
disablePluginsvoid disablePlugins()Disables all the loaded plugins
- 
clearPluginsvoid clearPlugins()Disables and removes all plugins
- 
callEventCalls an event with the given details- Parameters:
- event- Event details
- Throws:
- IllegalStateException- Thrown when an asynchronous event is fired from synchronous code.- Note: This is best-effort basis, and should not be used to test synchronized state. This is an indicator for flawed flow logic. 
 
- 
registerEventsRegisters all the events in the given listener class- Parameters:
- listener- Listener to register
- plugin- Plugin to register
 
- 
registerEventvoid registerEvent(@NotNull @NotNull Class<? extends Event> event, @NotNull @NotNull Listener listener, @NotNull @NotNull EventPriority priority, @NotNull @NotNull EventExecutor executor, @NotNull @NotNull Plugin plugin) Registers the specified executor to the given event class- Parameters:
- event- Event type to register
- listener- Listener to register
- priority- Priority to register this event at
- executor- EventExecutor to register
- plugin- Plugin to register
 
- 
registerEventvoid registerEvent(@NotNull @NotNull Class<? extends Event> event, @NotNull @NotNull Listener listener, @NotNull @NotNull EventPriority priority, @NotNull @NotNull EventExecutor executor, @NotNull @NotNull Plugin plugin, boolean ignoreCancelled) Registers the specified executor to the given event class- Parameters:
- event- Event type to register
- listener- Listener to register
- priority- Priority to register this event at
- executor- EventExecutor to register
- plugin- Plugin to register
- ignoreCancelled- Whether to pass cancelled events or not
 
- 
enablePluginEnables the specified pluginAttempting to enable a plugin that is already enabled will have no effect - Parameters:
- plugin- Plugin to enable
 
- 
disablePluginDisables the specified pluginAttempting to disable a plugin that is not enabled will have no effect - Parameters:
- plugin- Plugin to disable
 
- 
getPermissionGets aPermissionfrom its fully qualified name- Specified by:
- getPermissionin interface- PermissionManager
- Parameters:
- name- Name of the permission
- Returns:
- Permission, or null if none
 
- 
addPermissionAdds aPermissionto this plugin manager.If a permission is already defined with the given name of the new permission, an exception will be thrown. - Specified by:
- addPermissionin interface- PermissionManager
- Parameters:
- perm- Permission to add
- Throws:
- IllegalArgumentException- Thrown when a permission with the same name already exists
 
- 
removePermissionRemoves 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.- Specified by:
- removePermissionin interface- PermissionManager
- Parameters:
- perm- Permission to remove
 
- 
removePermissionRemoves 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.- Specified by:
- removePermissionin interface- PermissionManager
- Parameters:
- name- Permission to remove
 
- 
getDefaultPermissionsGets the default permissions for the given op status- Specified by:
- getDefaultPermissionsin interface- PermissionManager
- Parameters:
- op- Which set of default permissions to get
- Returns:
- The default permissions
 
- 
recalculatePermissionDefaultsRecalculates the defaults for the givenPermission.This will have no effect if the specified permission is not registered here. - Specified by:
- recalculatePermissionDefaultsin interface- PermissionManager
- Parameters:
- perm- Permission to recalculate
 
- 
subscribeToPermissionvoid subscribeToPermission(@NotNull @NotNull String permission, @NotNull @NotNull Permissible permissible) 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. - Specified by:
- subscribeToPermissionin interface- PermissionManager
- Parameters:
- permission- Permission to subscribe to
- permissible- Permissible subscribing
 
- 
unsubscribeFromPermissionvoid unsubscribeFromPermission(@NotNull @NotNull String permission, @NotNull @NotNull Permissible permissible) Unsubscribes the given Permissible for information about the requested Permission, by name.- Specified by:
- unsubscribeFromPermissionin interface- PermissionManager
- Parameters:
- permission- Permission to unsubscribe from
- permissible- Permissible subscribing
 
- 
getPermissionSubscriptionsGets a set containing all subscribedPermissibles to the given permission, by name- Specified by:
- getPermissionSubscriptionsin interface- PermissionManager
- Parameters:
- permission- Permission to query for
- Returns:
- Set containing all subscribed permissions
 
- 
subscribeToDefaultPermsSubscribes to the given Default permissions by operator statusIf the specified defaults change in any form, the Permissible will be asked to recalculate. - Specified by:
- subscribeToDefaultPermsin interface- PermissionManager
- Parameters:
- op- Default list to subscribe to
- permissible- Permissible subscribing
 
- 
unsubscribeFromDefaultPermsUnsubscribes from the given Default permissions by operator status- Specified by:
- unsubscribeFromDefaultPermsin interface- PermissionManager
- Parameters:
- op- Default list to unsubscribe from
- permissible- Permissible subscribing
 
- 
getDefaultPermSubscriptionsGets a set containing all subscribedPermissibles to the given default list, by op status- Specified by:
- getDefaultPermSubscriptionsin interface- PermissionManager
- Parameters:
- op- Default list to query for
- Returns:
- Set containing all subscribed permissions
 
- 
getPermissionsGets a set of all registered permissions.This set is a copy and will not be modified live. - Specified by:
- getPermissionsin interface- PermissionManager
- Returns:
- Set containing all current registered permissions
 
- 
useTimingsboolean useTimings()Returns whether or not timing code should be used for event calls- Returns:
- True if event timings are to be used
 
- 
isTransitiveDependency
- 
overridePermissionManager@Experimental void overridePermissionManager(@NotNull @NotNull Plugin plugin, @Nullable PermissionManager permissionManager) Sets the permission manager to be used for this server.- Parameters:
- permissionManager- permission manager
 
 
-