Files
FalsePatternLib/src/main/java/com/falsepattern/lib/config/Config.java
T

110 lines
2.6 KiB
Java
Raw Normal View History

2022-05-06 18:57:02 +02:00
package com.falsepattern.lib.config;
2022-05-06 23:53:11 +02:00
import com.falsepattern.lib.StableAPI;
2022-05-06 18:57:02 +02:00
2022-05-06 23:53:11 +02:00
import java.lang.annotation.*;
@Documented
2022-05-06 18:57:02 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
2022-05-06 23:53:11 +02:00
@StableAPI(since = "0.6.0")
2022-05-06 18:57:02 +02:00
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 {}
2022-05-07 01:33:04 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultBoolean {
boolean value();
}
2022-05-06 18:57:02 +02:00
@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 {
2022-05-07 01:33:04 +02:00
int value();
}
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface RangeFloat {
float min() default Float.MIN_VALUE;
float max() default Float.MAX_VALUE;
2022-05-06 23:48:24 +02:00
}
2022-05-06 18:57:02 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
2022-05-07 01:33:04 +02:00
@interface DefaultFloat {
float value();
}
2022-05-06 18:57:02 +02:00
2022-05-07 01:33:04 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultString {
String value();
2022-05-06 18:57:02 +02:00
}
2022-05-06 23:48:24 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
2022-05-07 01:33:04 +02:00
@interface Pattern {
String value();
2022-05-06 23:48:24 +02:00
}
2022-05-07 11:45:57 +02:00
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@interface DefaultEnum {
String value();
}
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 {}
}