Annotation Interface MaxValue
Specifies the maximum value for numeric configuration fields.
When a config value is loaded that is greater than the maximum,
it will be automatically clamped to the maximum value.
Supports: byte, short, int, long, float, double and their wrapper types.
Example:
@ConfigValue("max_players")
@MaxValue(100)
@Comment("Maximum players (maximum: 100)")
private int maxPlayers = 20;
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptiondoubleThe maximum allowed value for this field. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether to log a warning when a value is clamped.
-
Element Details
-
value
double valueThe maximum allowed value for this field.- Returns:
- the maximum value
-
warn
boolean warnWhether to log a warning when a value is clamped.- Returns:
- true to log warnings, false otherwise
- Default:
true
-