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.<T> TregisterConfig(String fileName, Class<T> configClass, ConfigSerializer serializer) Initializes and loads a configuration file for your plugin, using a custom serializer.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.
-
registerConfig
Initializes and loads a configuration file for your plugin, using a custom serializer. May be useful for serializing types that do not have a default GSON serializer. Or if you want to use a different file format (NBT, YAML, TOML, etc). -
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.
-