Skip to content

Creating a new module

DustinRepo edited this page May 14, 2022 · 10 revisions

Creating a module

To create a new module, create a class that extends me.dustin.feature.mod.core.Feature

To mark the module, use the annotation Manifest in me.dustin.feature.mod.core.Feature By default, only two values are needed in the annotation.

  1. Category: The category of the module
  2. Description: The description of the module

There are also optional values you can set

  1. Key: The keybind of the module. use GLFW.GLFW_KEY_key_name.
  2. Name: The name of the module. If not set, it will be automatically set to the name of the class
  3. Enabled: Whether or not the module is enabled by default

Your code should look something like this

import me.dustin.jex.feature.mod.core.Feature;
import org.lwjgl.glfw.GLFW;

@Feature.Manifest(name = "Example", category = Feature.Category.MISC, description = "Example", key = GLFW.GLFW_KEY_K)
public class ExampleFeature extends Feature {

}

Adding Options

Jex Options are very simple and easy to use. To create one, use the me.dustin.jex.feature.option.annotate.Op above a field. Use the ExampleFeature for some examples To create an option inside of another option use me.dustin.jex.feature.option.annotate.ChildOp and set the parent value to the name of the parent

Adding Events

To add events, you use the me.dustin.events.core.annotate.EventPointer above a me.dustin.events.core.EventListener field, using the event class as the type parameter. You can find all events here. See the ExampleFeature for examples.

Clone this wiki locally