Skip to content

Annotations

@AbeliaConfig

java
@AbeliaConfig(value = "modid", comment = {"第一行注释", "第二行注释"},
        type = ConfigType.COMMON, fieldsCaseFormat = CaseFormat.SNAKE_CASE)
public class ModConfig implements ConfigInitializer {
    @Override
    public @NotNull ConfigRegistry configure(ConfigRegistry registry) {
        return registry;
    }

    private boolean hideRealmsButton = false;
    private boolean hideFireOverlayWhenFireResistance = false;
}

@Ignored

忽略被标记的字段

@SerializedKey

设置被标记的字段的序列化键

java
@SerializedKey("username")
String name = "Gizmo";

@ConfigCaseFormat

java
@ConfigCaseFormat(CaseFormat.SNAKE_CASE)
public class SubConfig {
    String userName = "Gizmo";
}

@Comment

java
@Comment("Hide Realms Button")
private boolean hideRealmsButton = false;

@CollectionImpl

设置被标记的字段使用特定的 Collection 实现

java
@CollectionImpl(HashSet.class)
Set<String> hashSet;
@CollectionImpl(ArrayList.class)
List<String> list;

@Tooltip

java
@Tooltip
private boolean hideRealmsButton = false;
@Tooltip("config.modid.hide_fire_overlay_when_fire_resistance.@tooltip")
private boolean hideFireOverlayWhenFireResistance = false;

@Category

设置被标记的字段为特定的分类

java
@Category("demo")
private boolean hideRealmsButton = false;

@RequiresRestart

设置被标记的字段保存时是否需要重启客户端

java
@RequiresRestart
private boolean hideRealmsButton = false;

@LoaderSpecific

设置被标记的字段仅在特定模组加载器展示

java
@LoaderSpecific({LoaderType.NEOFORGE, LoaderType.FABRIC})
private boolean hideRealmsButton = false;
@LoaderSpecific(LoaderType.FABRIC)
private boolean fabricOnlyField = true;
@LoaderSpecific(LoaderType.NEOFORGE)
private boolean neoforgeOnlyField = true;

@Range

设置被标记的字段的范围

java
@Range.Integer(min = 0, max = 255)
private int intRangeField = 100;

Released under the CC BY-NC-SA 4.0.