-
Notifications
You must be signed in to change notification settings - Fork 0
How addons work
Addons system is an essential part of Visor architecture.
It allows to modify or extend parts of the Visor without using mixins.
It is built to support many addons at once with compatibility between each other.
Addons can be registered via VisorAPI#addonManager() only before VisorClient initialized. All registered addons are loaded during initialization of VisorClient.
Addons cannot be unloaded from Visor for better compatibility, predictability.
Visor Components are what you actually use to extend or modify Visor functionality.
Each component can be enabled/disabled and some of them supports priority, that affects on the order at which added components used.
Each component has its owner, i.e. Addon. And each component has its ID
To add your component to Visor you need to:
- get instance of registry you need and add your component there
- If component supports auto-registering, you can use annotation related specifically to that component
For auto-registering to work, you have to correctly specify the addon package path in VisorAddon.class. The path have to not collide with path of any other addon to not cause components to be re-registered multiple times
What are the component registries?
That is where components are managed. You can use them to add/remove any component via its ID or remove all components with specified owner.
Access visor component registries with: VisorAPI.addonManager().getRegistries()
You will get this interface, that has all available registries for addons