public class ExtendedJavaPlugin extends org.bukkit.plugin.java.JavaPlugin implements HelperPlugin
| Constructor and Description |
|---|
ExtendedJavaPlugin() |
| Modifier and Type | Method and Description |
|---|---|
<T extends AutoCloseable> |
bind(T terminable)
Binds with the given terminable.
|
<T extends TerminableModule> |
bindModule(T module)
Binds with the given terminable module.
|
protected void |
disable() |
protected void |
enable() |
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.
|
protected void |
load() |
org.bukkit.configuration.file.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.
|
void |
onDisable() |
void |
onEnable() |
void |
onLoad() |
<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,
org.bukkit.plugin.ServicePriority priority)
Provides a service to the ServiceManager, bound to this plugin
|
<T extends org.bukkit.command.CommandExecutor> |
registerCommand(T command,
String permission,
String permissionMessage,
String description,
String... aliases)
Registers a CommandExecutor with the server
|
<T extends org.bukkit.event.Listener> |
registerListener(T listener)
Register a listener with the server.
|
<T> T |
setupConfig(String file,
T configObject)
Populates a config object.
|
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitregisterCommandprotected void load()
protected void enable()
protected void disable()
public final void onLoad()
onLoad in interface org.bukkit.plugin.PluginonLoad in class org.bukkit.plugin.java.JavaPluginpublic final void onEnable()
onEnable in interface org.bukkit.plugin.PluginonEnable in class org.bukkit.plugin.java.JavaPluginpublic final void onDisable()
onDisable in interface org.bukkit.plugin.PluginonDisable in class org.bukkit.plugin.java.JavaPlugin@Nonnull public <T extends AutoCloseable> T bind(@Nonnull T terminable)
TerminableConsumerbind in interface TerminableConsumerT - the terminable typeterminable - the terminable to bind with@Nonnull public <T extends TerminableModule> T bindModule(@Nonnull T module)
TerminableConsumerbindModule in interface TerminableConsumerT - the module typemodule - the module to bind with@Nonnull public <T extends org.bukkit.event.Listener> T registerListener(@Nonnull T listener)
HelperPluginEvents should be used instead of this method in most cases.
registerListener in interface HelperPluginT - the listener class typelistener - the listener to register@Nonnull public <T extends org.bukkit.command.CommandExecutor> T registerCommand(@Nonnull T command, String permission, String permissionMessage, String description, @Nonnull String... aliases)
HelperPluginregisterCommand in interface HelperPluginT - 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 public <T> T getService(@Nonnull Class<T> service)
HelperPlugingetService in interface HelperPluginT - the class typeservice - the service class@Nonnull public <T> T provideService(@Nonnull Class<T> clazz, @Nonnull T instance, @Nonnull org.bukkit.plugin.ServicePriority priority)
HelperPluginprovideService in interface HelperPluginT - the service class typeclazz - the service classinstance - the instancepriority - the priority to register the service at@Nonnull public <T> T provideService(@Nonnull Class<T> clazz, @Nonnull T instance)
HelperPluginServicePriority.Normal.provideService in interface HelperPluginT - the service class typeclazz - the service classinstance - the instancepublic boolean isPluginPresent(@Nonnull String name)
HelperPluginisPluginPresent in interface HelperPluginname - the name of the plugin@Nullable public <T> T getPlugin(@Nonnull String name, @Nonnull Class<T> pluginClass)
HelperPlugingetPlugin in interface HelperPluginT - the main class typename - the name of the pluginpluginClass - the main plugin class@Nonnull public File getBundledFile(@Nonnull String name)
HelperPluginIf the file is not present, a version of it it copied from the jar.
getBundledFile in interface HelperPluginname - the name of the file@Nonnull public org.bukkit.configuration.file.YamlConfiguration loadConfig(@Nonnull String file)
HelperPluginBehaves in the same was as HelperPlugin.getBundledFile(String) when the file is not present.
loadConfig in interface HelperPluginfile - the name of the file@Nonnull public ninja.leaping.configurate.ConfigurationNode loadConfigNode(@Nonnull String file)
HelperPluginBehaves in the same was as HelperPlugin.getBundledFile(String) when the file is not present.
loadConfigNode in interface HelperPluginfile - the name of the file@Nonnull public <T> T setupConfig(@Nonnull String file, @Nonnull T configObject)
HelperPluginsetupConfig in interface HelperPluginT - the config object typefile - the name of the fileconfigObject - the config object@Nonnull public ClassLoader getClassloader()
HelperPlugingetClassloader in interface HelperPluginCopyright © 2022. All rights reserved.