Record Class InstancedPluginAPI
java.lang.Object
java.lang.Record
com.zenith.plugin.api.InstancedPluginAPI
- All Implemented Interfaces:
PluginAPI
public record InstancedPluginAPI(ZenithProxyPlugin pluginInstance, PluginInfo pluginInfo)
extends Record
implements PluginAPI
-
Constructor Summary
ConstructorsConstructorDescriptionInstancedPluginAPI(ZenithProxyPlugin pluginInstance, PluginInfo pluginInfo) Creates an instance of aInstancedPluginAPIrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.net.kyori.adventure.text.logger.slf4j.ComponentLoggerGets a logger configured for the plugin instance.Gets thePluginInfofor the plugin instance.final inthashCode()Returns a hash code value for this object.Returns the value of thepluginInforecord component.Returns the value of thepluginInstancerecord component.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.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InstancedPluginAPI
Creates an instance of aInstancedPluginAPIrecord class.- Parameters:
pluginInstance- the value for thepluginInstancerecord componentpluginInfo- the value for thepluginInforecord component
-
-
Method Details
-
registerConfig
Description copied from interface:PluginAPIInitializes and loads a configuration file for your plugin.- Specified by:
registerConfigin interfacePluginAPI- 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
Description copied from interface:PluginAPIRegisters aModule. Modules can listen to events, be toggled on and off, and register packet handlers- Specified by:
registerModulein interfacePluginAPI
-
registerCommand
Description copied from interface:PluginAPIRegisters aCommand. Commands can be executed in the terminal, by players in-game, and in discord.- Specified by:
registerCommandin interfacePluginAPI
-
getLogger
-
getPluginInfo
Description copied from interface:PluginAPIGets thePluginInfofor the plugin instance. This is the data encoded in the @Plugin annotation.- Specified by:
getPluginInfoin interfacePluginAPI
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
pluginInstance
Returns the value of thepluginInstancerecord component.- Returns:
- the value of the
pluginInstancerecord component
-
pluginInfo
Returns the value of thepluginInforecord component.- Returns:
- the value of the
pluginInforecord component
-