backport config annotations

This commit is contained in:
FalsePattern committed 2022-05-06 23:48:24 +02:00
1 parent 39fd0d62be
commit 016f1ad839
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 {