Usage
- Clone this repository or download zip
- Download the latest Samsara release
- Rename it to samsara.jar
- Put the file in your project folder
- You need a class that extends Addon
- The load() and unload() methods are called when the client is loaded and unloaded
- Now you can do anything you want except add mixins and resources
Modules
- Create a class that extends Module
- Make sure you don’t use the empty constructor
- Use ModuleManager.modules.add(ModuleClass()) to register it
Values
@Register(0) val aValue = Value("Name", true)
@Register(1) val anotherValue = ValueBuilder("DifferentName", 1.0).bounds(0.0, 2.0).build()
Events
@EventHandler
fun onEvent(event: ExampleEvent) {
// do stuff
}
Make sure to call EventHandler.register(ClassWithEventHandler())
Modules are automatically registered and unregistered in onEnable() and onDisable()