配置项

基本信息

属性 值
配置类 com.github.lunatrius.schematica.handler.ConfigurationHandler
加载入口 ConfigurationHandler.init(File) ← CommonProxy.preInit(proxy/CommonProxy.java:50)
重载入口 @SubscribeEvent onConfigurationChangedEvent(handler/ConfigurationHandler.java:405-410),按 Reference.MODID 忽略大小写匹配
配置文件版本 VERSION = "1"(handler/ConfigurationHandler.java:28)
GUI 分类键前缀 Names.Config.LANG_PREFIX = Reference.MODID.toLowerCase() + ".config"(reference/Names.java:84)→ 实际为 schematica.config
实际配置项总数 33(7 个生效分类)
失效分类 tooltip(reference/Names.java:14)

分类常量(reference/Names.java:8-18):debug / render / printer / printer.swapslots / tooltip / general / server / tool。

⚠️ tooltip 分类是死代码。Names.Config.Category.TOOLTIP、TOOLTIP_ENABLED、TOOLTIP_X、TOOLTIP_Y 及其描述常量共 7 个(reference/Names.java:14, 54-59)在全仓库没有任何引用点——ConfigurationHandler.loadConfiguration()(handler/ConfigurationHandler.java:129-367)不读取它们,因此配置文件里不会出现这三个键,GUI 也不会显示该分类。

功能

所有配置在 ConfigurationHandler.loadConfiguration() 中一次性读取,每个键通过 setLanguageKey(Names.Config.LANG_PREFIX + "." + 键名) 注册本地化。GUI 由 client/gui/GuiModConfig.java:29-39 遍历 ConfigurationHandler.configuration.getCategoryNames() 自动生成,因此新增配置无需改 GUI 代码。

数值

debug(1 项)

键 类型 默认 范围 作用
showDebugInfo boolean true — F3 调试屏显示蓝图尺寸、工具模式、准星方块(handler/ConfigurationHandler.java:130-136;渲染见 handler/client/OverlayHandler.java:31-46)

render(7 项)

键 类型 默认 范围 作用
alphaEnabled boolean false — 启用透明贴图(:138-144)
alpha double 1.0 0.0–1.0 投影不透明度,1.0 全不透明(:146-149)
highlight boolean true — 高亮非法/待放置方块(:151-154)
highlightAir boolean true — 高亮「本应是空气」的位置(:156-162)
blockDelta double 0.005 0.0–0.2 高亮深度偏移,z-fighting 时调高(:164-172)
drawQuads boolean true — 绘制面(:174-180)
drawLines boolean true — 绘制轮廓线(:182-188)

printer(6 项)

键 类型 默认 范围 作用
placeDelay int 1 0–20 两次放置尝试的间隔 tick(:190-198)
timeout int 10 0–100 重试失败方块前的超时 tick(:200-208)
placeInstantly boolean false — 一 tick 内放完所有可放置方块(:210-216)
destroyBlocks boolean false — 打印机破坏方块(:218-224)
destroyInstantly boolean false — 一 tick 内破坏所有可破坏方块(:226-232)
placeAdjacent boolean true — 仅当相邻位置有方块时才放置(:234-240)

printer.swapslots(9 项)

swapSlot0 … swapSlot8 共 9 个独立布尔项(handler/ConfigurationHandler.java:242-255),对应快捷栏 9 格。默认值数组为 { false, false, false, false, false, true, true, true, true }(:47-48)——第 1–5 格禁用,第 6–9 格启用。

启用项会被推入 swapSlotsQueue(:78、:252-254),打印机只从这些槽位取材料。

general(4 项)

键 类型 默认 作用
schematicDirectory String "schematics" 蓝图目录。加载时会被规范化,并在位于数据目录内时转为相对路径写回配置(:257-280)
extraAirBlocks String[] {} 渲染时视为空气的额外方块列表,按注册名逐个查 GameData.getBlockRegistry() 并剔除 Blocks.air(:282-297);查询入口 isExtraAirBlock(Block)(:412-414)
useSchematicplusFormat boolean false 切换 schemplus 扩展 ID 格式。开启后只加载该格式的蓝图(描述见 reference/Names.java:23)
sortType String "" 材料列表默认排序方式。setShowInGui(false)(:309),只存在于配置文件,不在 GUI 显示

tool(1 项)

键 类型 默认 作用
toolItem String "minecraft:stick" 工具物品。格式 modid:name 或 modid:name@meta(reference/Names.java:69)

parseToolItem(:374-401)解析后缓存到 toolItemType / toolItemMeta(meta = -1 表示忽略 meta);查不到时回退 minecraft:stick 并打 warn 日志(:397-400)。

server(5 项)

键 类型 默认 作用
printerEnabled boolean true 允许玩家使用投影打印(:321-327)
saveEnabled boolean true 允许保存蓝图(:329-335)
loadEnabled boolean true 允许加载蓝图(:337-343)
playerQuotaKilobytes int 8192 每玩家服务器蓝图存储配额(KB = 8 MB)(:59、:345-351)
serversideSchematicsEnabled boolean true 总开关,决定 4 条服务器指令是否注册(:353-360)

交互

serversideSchematicsEnabled 是唯一影响服务端注册行为的配置:CommonProxy.serverStarting()(proxy/CommonProxy.java:69-73)与 ServerProxy.serverStarting()(proxy/ServerProxy.java:33-35)都以此为条件,为 false 时 /schematicaSave、/schematicaList、/schematicaRemove、/schematicaDownload 全部不注册。

printerEnabled / saveEnabled / loadEnabled 三项通过 MessageCapabilities 封包(discriminator 0)下发给客户端,见 网络封包。

playerQuotaKilobytes 的判定在 ServerProxy.isPlayerQuotaExceeded(proxy/ServerProxy.java:56-67):把玩家 private 与 public 两个目录的文件字节总和除以 1024 后与配置比较,超过即拒绝。该值对所有玩家统一生效,无分权限例外。

相关条目

  • 指令 - 5 条指令,其中 4 条受 serversideSchematicsEnabled 控制
  • 工具模式 - toolItem 决定的手持工具与模式切换
  • 蓝图格式 - useSchematicplusFormat 切换的存档格式