-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
PluginConfig.java
37 lines (27 loc) · 1.63 KB
/
PluginConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package cc.carm.plugin.timereward.conf;
import cc.carm.lib.configuration.core.ConfigurationRoot;
import cc.carm.lib.configuration.core.annotation.HeaderComment;
import cc.carm.lib.configuration.core.value.ConfigValue;
import cc.carm.lib.configuration.core.value.type.ConfiguredValue;
import java.time.DayOfWeek;
public class PluginConfig extends ConfigurationRoot {
public static final ConfigValue<Boolean> DEBUG = ConfiguredValue.of(Boolean.class, false);
@HeaderComment({
"统计数据设定",
"该选项用于帮助开发者统计插件版本与使用情况,且绝不会影响性能与使用体验。",
"当然,您也可以选择在这里关闭,或在plugins/bStats下的配置文件中关闭。"
})
public static final ConfigValue<Boolean> METRICS = ConfiguredValue.of(Boolean.class, true);
@HeaderComment({
"检查更新设定",
"该选项用于插件判断是否要检查更新,若您不希望插件检查更新并提示您,可以选择关闭。",
"检查更新为异步操作,绝不会影响性能与使用体验。"
})
public static final ConfigValue<Boolean> CHECK_UPDATE = ConfiguredValue.of(Boolean.class, true);
@HeaderComment("周起始日,用于判断周度奖励的结算日期。")
public static final ConfigValue<DayOfWeek> WEEK_FIRST_DAY = ConfiguredValue.builderOf(DayOfWeek.class)
.from(Integer.class).serializeSource(i -> i).parseSource(i -> (Integer) i)
.parseValue((v, d) -> DayOfWeek.of(v))
.serializeValue(DayOfWeek::getValue)
.defaults(DayOfWeek.MONDAY).build();
}