Created Components (markdown)
parent
ad21b56683
commit
8f0c4b87b0
1 changed files with 7 additions and 0 deletions
7
Components.md
Normal file
7
Components.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
Most of the functionality of the Chroma plugins are grouped into components. These components can be enabled/disabled at runtime both temporarily and permanently (so it doesn't load on the next start either). To make a new component, create a new class that inherits from `Component<YourPluginClass>` and implement the `enable()` and `disable()` methods. Note that components can be enabled/disabled multiple times while the server is running.
|
||||
|
||||
You also need to register the component to your plugin. Do `Component.registerComponent(this, new SomeComponent());` where `this` is your plugin instance. All registered components are enabled automatically by default. You can use the `@ComponentMetadata` annotation's option to make a given component disabled by default.
|
||||
|
||||
You can also override the `register()` and `unregister()` methods which run when you call the corresponding methods.
|
||||
|
||||
You don't need to unregister components if you're using `ButtonPlugin`, as in that case they are unregistered between `pluginPreDisable()` and `pluginDisable()`.
|
Loading…
Reference in a new issue