2022-05-06 18:57:02 +02:00
|
|
|
package com.falsepattern.lib.config;
|
|
|
|
|
|
|
|
|
|
import java.lang.annotation.ElementType;
|
|
|
|
|
import java.lang.annotation.Retention;
|
|
|
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
|
import java.lang.annotation.Target;
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.TYPE)
|
|
|
|
|
public @interface Config {
|
|
|
|
|
/**
|
|
|
|
|
* The mod id that this configuration is associated with.
|
|
|
|
|
*/
|
|
|
|
|
String modid();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A user friendly name for the config file,
|
|
|
|
|
* the default will be modid
|
|
|
|
|
*/
|
|
|
|
|
String name() default "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Root element category, defaults to "general", if this is an empty string then the root category is disabled.
|
|
|
|
|
* Any primitive fields will cause an error, and you must specify sub-category objects
|
|
|
|
|
*/
|
|
|
|
|
String category() default "general";
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target({ElementType.FIELD, ElementType.TYPE})
|
|
|
|
|
@interface LangKey {
|
|
|
|
|
String value();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface Comment {
|
|
|
|
|
String[] value();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface Ignore {}
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface RangeInt {
|
|
|
|
|
int min() default Integer.MIN_VALUE;
|
|
|
|
|
|
|
|
|
|
int max() default Integer.MAX_VALUE;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-06 23:48:24 +02:00
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface DefaultInt {
|
|
|
|
|
int value() default 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-06 18:57:02 +02:00
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface RangeDouble {
|
|
|
|
|
double min() default Double.MIN_VALUE;
|
|
|
|
|
|
|
|
|
|
double max() default Double.MAX_VALUE;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-06 23:48:24 +02:00
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface DefaultDouble {
|
|
|
|
|
double value() default 0d;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-06 18:57:02 +02:00
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target(ElementType.FIELD)
|
|
|
|
|
@interface Name {
|
|
|
|
|
String value();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target({ElementType.FIELD, ElementType.TYPE})
|
|
|
|
|
@interface RequiresMcRestart {}
|
|
|
|
|
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Target({ElementType.FIELD, ElementType.TYPE})
|
|
|
|
|
@interface RequiresWorldRestart {}
|
|
|
|
|
}
|