Package net.storm.api.plugins.config
Annotation Interface Units
Annotation that specifies the units to display alongside a numeric configuration value.
When applied to a ConfigItem method that returns a numeric type,
the specified units will be displayed next to the input field in the
configuration panel. This helps users understand what the value represents.
Common unit constants are provided for convenience:
MILLISECONDS- "ms"SECONDS- "s"MINUTES- " mins"TICKS- " ticks"PERCENT- "%"PIXELS- "px"GP- " GP"
Example usage:
@ConfigItem(
keyName = "refreshInterval",
name = "Refresh Interval",
description = "How often to refresh data"
)
@Units(Units.MILLISECONDS)
@Range(min = 100, max = 5000)
default int refreshInterval() {
return 1000;
}
- See Also:
-
Required Element Summary
Required Elements -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFrames per second unit: " fps"static final StringGold pieces unit: " GP"static final StringLevels unit: " lvls"static final StringMilliseconds unit: "ms"static final StringMinutes unit: " mins"static final StringPercent unit: "%"static final StringPixels unit: "px"static final StringPoints unit: "pt"static final StringSeconds unit: "s"static final StringGame ticks unit: " ticks"
-
Field Details
-
MILLISECONDS
Milliseconds unit: "ms"- See Also:
-
MINUTES
Minutes unit: " mins"- See Also:
-
PERCENT
Percent unit: "%"- See Also:
-
PIXELS
Pixels unit: "px"- See Also:
-
POINTS
Points unit: "pt"- See Also:
-
SECONDS
Seconds unit: "s"- See Also:
-
TICKS
Game ticks unit: " ticks"- See Also:
-
LEVELS
Levels unit: " lvls"- See Also:
-
FPS
Frames per second unit: " fps"- See Also:
-
GP
Gold pieces unit: " GP"- See Also:
-
-
Element Details
-
value
String valueThe units string to display.Use one of the predefined constants or a custom string.
- Returns:
- the units text
-