public interface HelperPlugin extends Plugin, TerminableConsumer
| Modifier and Type | Method and Description |
|---|---|
File |
getBundledFile(String name)
Gets a bundled file from the plugins resource folder.
|
ClassLoader |
getClassloader()
Gets the plugin's class loader
|
<T> T |
getPlugin(String name,
Class<T> pluginClass)
Gets a plugin instance for the given plugin name
|
<T> T |
getService(Class<T> service)
Gets a service provided by the ServiceManager
|
boolean |
isPluginPresent(String name)
Gets if a given plugin is enabled.
|
YamlConfiguration |
loadConfig(String file)
Loads a config file from a file name.
|
ninja.leaping.configurate.ConfigurationNode |
loadConfigNode(String file)
Loads a config file from a file name.
|
<T> T |
provideService(Class<T> clazz,
T instance)
Provides a service to the ServiceManager, bound to this plugin at
ServicePriority.Normal. |
<T> T |
provideService(Class<T> clazz,
T instance,
ServicePriority priority)
Provides a service to the ServiceManager, bound to this plugin
|
default <T extends CommandExecutor> |
registerCommand(T command,
String... aliases)
Registers a CommandExecutor with the server
|
<T extends CommandExecutor> |
registerCommand(T command,
String permission,
String permissionMessage,
String description,
String... aliases)
Registers a CommandExecutor with the server
|
<T extends Listener> |
registerListener(T listener)
Register a listener with the server.
|
<T> T |
setupConfig(String file,
T configObject)
Populates a config object.
|
getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getLogger, getName, getPluginLoader, getResource, getServer, isEnabled, isNaggable, onDisable, onEnable, onLoad, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setNaggableonTabCompleteonCommandbind, bindModule@Nonnull <T extends Listener> T registerListener(@Nonnull T listener)
Events should be used instead of this method in most cases.
T - the listener class typelistener - the listener to register@Nonnull default <T extends CommandExecutor> T registerCommand(@Nonnull T command, @Nonnull String... aliases)
T - the command executor class typecommand - the command instancealiases - the command aliases@Nonnull <T extends CommandExecutor> T registerCommand(@Nonnull T command, String permission, String permissionMessage, String description, @Nonnull String... aliases)
T - the command executor class typecommand - the command instancepermission - the command permissionpermissionMessage - the message sent when the sender doesn't the required permissiondescription - the command descriptionaliases - the command aliases@Nonnull <T> T getService(@Nonnull Class<T> service)
T - the class typeservice - the service class@Nonnull <T> T provideService(@Nonnull Class<T> clazz, @Nonnull T instance, @Nonnull ServicePriority priority)
T - the service class typeclazz - the service classinstance - the instancepriority - the priority to register the service at@Nonnull <T> T provideService(@Nonnull Class<T> clazz, @Nonnull T instance)
ServicePriority.Normal.T - the service class typeclazz - the service classinstance - the instanceboolean isPluginPresent(@Nonnull String name)
name - the name of the plugin@Nullable <T> T getPlugin(@Nonnull String name, @Nonnull Class<T> pluginClass)
T - the main class typename - the name of the pluginpluginClass - the main plugin class@Nonnull File getBundledFile(@Nonnull String name)
If the file is not present, a version of it it copied from the jar.
name - the name of the file@Nonnull YamlConfiguration loadConfig(@Nonnull String file)
Behaves in the same was as getBundledFile(String) when the file is not present.
file - the name of the file@Nonnull ninja.leaping.configurate.ConfigurationNode loadConfigNode(@Nonnull String file)
Behaves in the same was as getBundledFile(String) when the file is not present.
file - the name of the file@Nonnull <T> T setupConfig(@Nonnull String file, @Nonnull T configObject)
T - the config object typefile - the name of the fileconfigObject - the config object@Nonnull ClassLoader getClassloader()
Copyright © 2020. All rights reserved.