Class SimplePluginManager
- All Implemented Interfaces:
- PluginManager
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPermission(Permission perm) Adds aPermissionto this plugin manager.voidaddPermission(Permission perm, boolean dirty) Deprecated.voidCalls an event with the given details.voidDisables and removes all pluginsvoidDeprecated.voiddisablePlugin(Plugin plugin) Disables the specified pluginvoidDisables all the loaded pluginsvoidenablePlugin(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(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[]Gets a list of all currently loaded pluginsbooleanisPluginEnabled(String name) Checks if the given plugin is enabled or notbooleanisPluginEnabled(Plugin plugin) Checks if the given plugin is enabled or notbooleanisTransitiveDepend(PluginDescriptionFile plugin, PluginDescriptionFile depend) loadPlugin(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
- 
Constructor Details- 
SimplePluginManager
 
- 
- 
Method Details- 
registerInterfacepublic void registerInterface(@NotNull Class<? extends PluginLoader> loader) throws IllegalArgumentException Registers the specified plugin loader- Specified by:
- registerInterfacein interface- PluginManager
- Parameters:
- loader- Class name of the PluginLoader to register
- Throws:
- IllegalArgumentException- Thrown when the given Class is not a valid PluginLoader
 
- 
loadPluginsLoads the plugins contained within the specified directory- Specified by:
- loadPluginsin interface- PluginManager
- Parameters:
- directory- Directory to check for plugins
- Returns:
- A list of all plugins loaded
 
- 
loadPlugin@Nullable public Plugin loadPlugin(@NotNull File file) throws InvalidPluginException, UnknownDependencyException Loads the plugin in the specified fileFile must be valid according to the current enabled Plugin interfaces - Specified by:
- loadPluginin interface- PluginManager
- 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
- UnknownDependencyException- If a required dependency could not be found
 
- 
getPluginChecks if the given plugin is loaded and returns it when applicablePlease note that the name of the plugin is case-sensitive - Specified by:
- getPluginin interface- PluginManager
- Parameters:
- name- Name of the plugin to check
- Returns:
- Plugin if it exists, otherwise null
 
- 
getPluginsDescription copied from interface:PluginManagerGets a list of all currently loaded plugins- Specified by:
- getPluginsin interface- PluginManager
- Returns:
- Array of Plugins
 
- 
isPluginEnabledChecks if the given plugin is enabled or notPlease note that the name of the plugin is case-sensitive. - Specified by:
- isPluginEnabledin interface- PluginManager
- 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- Specified by:
- isPluginEnabledin interface- PluginManager
- Parameters:
- plugin- Plugin to check
- Returns:
- true if the plugin is enabled, otherwise false
 
- 
enablePluginDescription copied from interface:PluginManagerEnables the specified pluginAttempting to enable a plugin that is already enabled will have no effect - Specified by:
- enablePluginin interface- PluginManager
- Parameters:
- plugin- Plugin to enable
 
- 
disablePluginspublic void disablePlugins()Description copied from interface:PluginManagerDisables all the loaded plugins- Specified by:
- disablePluginsin interface- PluginManager
 
- 
disablePluginDescription copied from interface:PluginManagerDisables the specified pluginAttempting to disable a plugin that is not enabled will have no effect - Specified by:
- disablePluginin interface- PluginManager
- Parameters:
- plugin- Plugin to disable
 
- 
clearPluginspublic void clearPlugins()Description copied from interface:PluginManagerDisables and removes all plugins- Specified by:
- clearPluginsin interface- PluginManager
 
- 
callEventCalls an event with the given details.- Specified by:
- callEventin interface- PluginManager
- Parameters:
- event- Event details
 
- 
registerEventsDescription copied from interface:PluginManagerRegisters all the events in the given listener class- Specified by:
- registerEventsin interface- PluginManager
- Parameters:
- listener- Listener to register
- plugin- Plugin to register
 
- 
registerEventpublic void registerEvent(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin) Description copied from interface:PluginManagerRegisters the specified executor to the given event class- Specified by:
- registerEventin interface- PluginManager
- 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
 
- 
registerEventpublic void registerEvent(@NotNull Class<? extends Event> event, @NotNull Listener listener, @NotNull EventPriority priority, @NotNull EventExecutor executor, @NotNull Plugin plugin, boolean ignoreCancelled) Registers the given event to the specified listener using a directly passed EventExecutor- Specified by:
- registerEventin interface- PluginManager
- Parameters:
- 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
 
- 
getPermissionDescription copied from interface:PluginManagerGets aPermissionfrom its fully qualified name- Specified by:
- getPermissionin interface- PluginManager
- Parameters:
- name- Name of the permission
- Returns:
- Permission, or null if none
 
- 
addPermissionDescription copied from interface:PluginManagerAdds 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- PluginManager
- Parameters:
- perm- Permission to add
 
- 
addPermissionDeprecated.
- 
getDefaultPermissionsDescription copied from interface:PluginManagerGets the default permissions for the given op status- Specified by:
- getDefaultPermissionsin interface- PluginManager
- Parameters:
- op- Which set of default permissions to get
- Returns:
- The default permissions
 
- 
removePermissionDescription copied from interface: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.- Specified by:
- removePermissionin interface- PluginManager
- Parameters:
- perm- Permission to remove
 
- 
removePermissionDescription copied from interface: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.- Specified by:
- removePermissionin interface- PluginManager
- Parameters:
- name- Permission to remove
 
- 
recalculatePermissionDefaultsDescription copied from interface:PluginManagerRecalculates the defaults for the givenPermission.This will have no effect if the specified permission is not registered here. - Specified by:
- recalculatePermissionDefaultsin interface- PluginManager
- Parameters:
- perm- Permission to recalculate
 
- 
dirtyPermissiblesDeprecated.
- 
subscribeToPermissionDescription copied from interface: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. - Specified by:
- subscribeToPermissionin interface- PluginManager
- Parameters:
- permission- Permission to subscribe to
- permissible- Permissible subscribing
 
- 
unsubscribeFromPermissionDescription copied from interface:PluginManagerUnsubscribes the given Permissible for information about the requested Permission, by name.- Specified by:
- unsubscribeFromPermissionin interface- PluginManager
- Parameters:
- permission- Permission to unsubscribe from
- permissible- Permissible subscribing
 
- 
getPermissionSubscriptionsDescription copied from interface:PluginManagerGets a set containing all subscribedPermissibles to the given permission, by name- Specified by:
- getPermissionSubscriptionsin interface- PluginManager
- Parameters:
- permission- Permission to query for
- Returns:
- Set containing all subscribed permissions
 
- 
subscribeToDefaultPermsDescription copied from interface:PluginManagerSubscribes 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- PluginManager
- Parameters:
- op- Default list to subscribe to
- permissible- Permissible subscribing
 
- 
unsubscribeFromDefaultPermsDescription copied from interface:PluginManagerUnsubscribes from the given Default permissions by operator status- Specified by:
- unsubscribeFromDefaultPermsin interface- PluginManager
- Parameters:
- op- Default list to unsubscribe from
- permissible- Permissible subscribing
 
- 
getDefaultPermSubscriptionsDescription copied from interface:PluginManagerGets a set containing all subscribedPermissibles to the given default list, by op status- Specified by:
- getDefaultPermSubscriptionsin interface- PluginManager
- Parameters:
- op- Default list to query for
- Returns:
- Set containing all subscribed permissions
 
- 
getPermissionsDescription copied from interface:PluginManagerGets a set of all registered permissions.This set is a copy and will not be modified live. - Specified by:
- getPermissionsin interface- PluginManager
- Returns:
- Set containing all current registered permissions
 
- 
isTransitiveDependpublic boolean isTransitiveDepend(@NotNull PluginDescriptionFile plugin, @NotNull PluginDescriptionFile depend) 
- 
useTimingspublic boolean useTimings()Description copied from interface:PluginManagerReturns whether or not timing code should be used for event calls- Specified by:
- useTimingsin interface- PluginManager
- Returns:
- True if event timings are to be used
 
- 
useTimingspublic void useTimings(boolean use) Sets whether or not per event timing code should be used- Parameters:
- use- True if per event timing code should be used
 
 
-