public class ExtendedJavaPlugin extends JavaPlugin implements HelperPlugin
| Constructor and Description |
|---|
ExtendedJavaPlugin() |
| Modifier and Type | Method and Description |
|---|---|
<T extends Terminable> |
bind(T terminable)
Binds with the given terminable.
|
<T extends CompositeTerminable> |
bindComposite(T terminable)
Binds a composite terminable to this consumer
|
<T extends Runnable> |
bindRunnable(T runnable)
Binds with the given runnable.
|
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
|
protected void |
load() |
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,
ServicePriority priority)
Provides a service to the ServiceManager, bound to this plugin
|
<T extends CommandExecutor> |
registerCommand(T command,
String... aliases)
Registers a CommandExecutor with the server
|
<T extends Listener> |
registerListener(T listener)
Register a listener with the server.
|
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringequals, getName, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetConfig, getDataFolder, getDefaultWorldGenerator, getDescription, getLogger, getName, getPluginLoader, getResource, getServer, isEnabled, isNaggable, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setNaggableonTabCompleteonCommandprotected void load()
protected void enable()
protected void disable()
public final void onLoad()
onLoad in interface PluginonLoad in class JavaPluginpublic final void onEnable()
onEnable in interface PluginonEnable in class JavaPluginpublic final void onDisable()
onDisable in interface PluginonDisable in class JavaPlugin@Nonnull public <T extends Terminable> T bind(@Nonnull T terminable)
TerminableConsumerbind in interface TerminableConsumerT - the terminable typeterminable - the terminable to bind with@Nonnull public <T extends Runnable> T bindRunnable(@Nonnull T runnable)
TerminableConsumerbindRunnable in interface TerminableConsumerT - the terminable typerunnable - the runnable to bind with@Nonnull public <T extends CompositeTerminable> T bindComposite(@Nonnull T terminable)
CompositeTerminableConsumerbindComposite in interface CompositeTerminableConsumerT - the terminable class typeterminable - the terminable to bind@Nonnull public <T extends 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 CommandExecutor> T registerCommand(@Nonnull T command, @Nonnull String... aliases)
HelperPluginregisterCommand in interface HelperPluginT - the command executor class typecommand - the command instancealiases - the command aliases@Nullable 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 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 instance@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 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 filepublic ClassLoader getClassloader()
HelperPlugingetClassloader in interface HelperPluginCopyright © 2017. All rights reserved.