mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-15 12:34:45 +00:00
backport config annotations
This commit is contained in:
3 files changed
+126
-19
No files matched your search
@@ -25,21 +25,6 @@ public @interface Config {
|
||||
*/
|
||||
String category() default "general";
|
||||
|
||||
public static enum Type {
|
||||
/**
|
||||
* Loaded once, directly after mod construction. Before pre-init.
|
||||
* This class must have static fields.
|
||||
*/
|
||||
INSTANCE(true);
|
||||
|
||||
|
||||
private boolean isStatic = true;
|
||||
|
||||
private Type(boolean isStatic) {this.isStatic = isStatic;}
|
||||
|
||||
public boolean isStatic() {return this.isStatic;}
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD, ElementType.TYPE})
|
||||
@interface LangKey {
|
||||
@@ -64,6 +49,12 @@ public @interface Config {
|
||||
int max() default Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@interface DefaultInt {
|
||||
int value() default 0;
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@interface RangeDouble {
|
||||
@@ -72,6 +63,12 @@ public @interface Config {
|
||||
double max() default Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@interface DefaultDouble {
|
||||
double value() default 0d;
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@interface Name {
|
||||
|
||||
Reference in new issue
Block a user