diff --git a/Components.md b/Components.md new file mode 100644 index 0000000..f5f9b96 --- /dev/null +++ b/Components.md @@ -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` 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()`.