Interface PluginAPI
- All Known Implementing Classes:
InstancedPluginAPI
public interface PluginAPI
-
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.logger.slf4j.ComponentLoggerGets a logger configured for the plugin instance.Gets thePluginInfofor the plugin instance.voidregisterCommand(Command command) Registers aCommand.<T> TregisterConfig(String fileName, Class<T> configClass) Initializes and loads a configuration file for your plugin.voidregisterModule(Module module) Registers aModule.
-
Method Details
-
registerConfig
Initializes and loads a configuration file for your plugin.- Parameters:
fileName- The name of the file to save and load. Example: "example-config" would have its config at: "plugins/config/example-config.json"configClass- The configuration POJO class that is saved and loaded- Returns:
- Configuration instance. This instance must be used for access and modifications to the configuration. If no configuration file exists yet, a new instance will still be created and returned.
-
registerModule
-
registerCommand
-
getLogger
net.kyori.adventure.text.logger.slf4j.ComponentLogger getLogger()Gets a logger configured for the plugin instance. -
getPluginInfo
PluginInfo getPluginInfo()Gets thePluginInfofor the plugin instance. This is the data encoded in the @Plugin annotation.
-