Skip to content

Annotations

kr1v edited this page Mar 26, 2026 · 3 revisions

Annotations

@Config (Class annotation):

  • value:
    • Defines which screen/mod this config class belongs to.
  • name:
    • Defines the tab name. Defaults to the same as the class name.
  • defaultEnabled:
    • Dictates for ConfigBooleanPlus configs what should be the default value if not specified. Defaults to true.
  • order:
    • Definest in which order the tab should show up in in the GUI. If there are 2 tabs with the same order, alphabetical order will be used. Defaults to 1000

@PopupConfig (Inner class annotation):

  • name:
    • Name of the config. Defaults to the same as the class name.
  • buttonName:
    • Name of the button. Defaults to "Edit " + the class name.
  • defaultEnabled
    • See @Config's defaultEnabled.
  • width:
    • Defines the width of the popup config. Defaults to fit the width of the configs and at least 400.
  • height:
    • Defines the height of the popup config. Defaults to 300
  • distanceFromSides:
    • Defines the distance from the left and right sides of the screen. If not set to -1, will adjust the width to fit the screen.
  • distanceFromTops:
    • Defines the distance from the top and bottom sides of the screen. If not set to -1, will adjust the height to fit the screen.

@Label: Adds a label at this point in the config. For example, the following code:

@Label("This is a test double")
public static final ConfigDoublePlus DOUBLE = new ConfigDoublePlus("Test double");

Will look like this:

image
  • value:
    • Defines what the label should display as. Defaults to "", which acts as a newline.

@Marker: Marks a point in the config. See @Extras

  • value:
    • Defines the name of the point

@Extras (Static method annotation): Adds entries to the config list, given the method annotated has List<IConfigBase> as its only argument, and is a static void. For example, the following code:

 public static final ConfigBooleanPlus TEST_BOOLEAN = new ConfigBooleanPlus("Test boolean");
 @Extras
 public static void addTests(List<IConfigBase> existingList) {
 	for (int i = 0; i < 6; i++) {
 		existingList.add(new ConfigBooleanPlus("Test! " + i));
 	}
 }
 public static final ConfigDoublePlus TEST_DOUBLE = new ConfigDoublePlus("Test double");

Will add 5 ConfigBooleanPlus entries in between Test boolean and Test double.

  • runAt:
    • If "", will run at that point in the config (as above). If anything else, will look for all @Markers in the same class and will run at that point in the config. Defaults to "".

@Hide (Field annotation): Will hide it visually from the config menu, but will still be saved/loaded.

Clone this wiki locally