mirror of
https://github.com/xzb23/Minecraft-Command-Permission-Control.git
synced 2026-11-22 08:44:36 +08:00
整理代码 and 使用配置文件保存配置
This commit is contained in:
3 files changed
+32
-54
No files matched your search
@@ -17,22 +17,22 @@ import net.neoforged.neoforge.common.ModConfigSpec;
|
||||
public class Config {
|
||||
private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder();
|
||||
|
||||
public static final ModConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER
|
||||
.comment("Whether to log the dirt block on common setup")
|
||||
.define("logDirtBlock", true);
|
||||
public static final ModConfigSpec.IntValue VERSION = BUILDER
|
||||
.comment("Config Version")
|
||||
.defineInRange("version", 1, 0, Integer.MAX_VALUE);
|
||||
|
||||
|
||||
public static final ModConfigSpec.ConfigValue<List<? extends String>> BLOCKED_COMMANDS = BUILDER
|
||||
.comment("禁用的指令列表")
|
||||
.defineList("blocked_commands", List.of("give", "fill"), obj -> obj instanceof String);
|
||||
|
||||
|
||||
public static final ModConfigSpec.ConfigValue<String> BROADCASTMSG = BUILDER
|
||||
.comment("有人作弊时的广播内容")
|
||||
.define("broadcastmsg", "§c不准作弊哦(>v0");
|
||||
|
||||
public static final ModConfigSpec.IntValue MAGIC_NUMBER = BUILDER
|
||||
.comment("A magic number")
|
||||
.defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
|
||||
|
||||
public static final ModConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER
|
||||
.comment("What you want the introduction message to be for the magic number")
|
||||
.define("magicNumberIntroduction", "The magic number is... ");
|
||||
|
||||
// a list of strings that are treated as resource locations for items
|
||||
public static final ModConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER
|
||||
.comment("A list of items to log on common setup.")
|
||||
.defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), () -> "", Config::validateItemName);
|
||||
|
||||
static final ModConfigSpec SPEC = BUILDER.build();
|
||||
|
||||
|
||||
Reference in new issue
Block a user