Config Swapper 是一个用于切换预定义配置选项数量的工具。适用于更改游戏模式。
它通过查找并更改实际配置文件中的字符串来实现这一功能。
这意味着它应该与大多数模组兼容,即使它们实现了某种形式的自定义配置(目前仅支持 TOML 格式的配置)。
Config Swapper 添加了一个用于更改配置的命令 "/mode <modename>",并在实例根目录中创建了一个名为 mode.json 的文件,其中包含当前模式。
在启动时,mode.json 中的模式会被应用到游戏中,以支持整合包更新。
特定配置选项是否需要重启取决于各个模组。如果需要,请联系具体的模组开发者。
/mode 命令还会运行 /reload,以确保玩家不会忘记执行此操作。
请注意,Configswapper 无法以任何方式还原模式。因此,所有配置更改都必须在每个模式中明确指定。
创建配置模式
首次加载时,模组会在 config 文件夹中创建一个名为 "configswapper" 的文件夹。
在此处,用你的模式名称创建一个文件夹。例如:"expert"。
在此文件夹中使用与实例根目录相同的文件夹结构。
例如,要更改 config/forge-client.toml 中的值,请添加一个名为 config 的文件夹和一个名为 forge-client.toml 的文件。
将你要更改的配置的类别和键 + 值组合以与原始文件相同的格式添加到文件中。
最简单的方法是复制原始文件,并删除你不希望更改的所有值。
对于服务器配置文件,请将它们放入名为 serverconfig 的文件夹中。
2.0 之前的格式
要添加配置更改,你需要知道:
- 模组的 Mod ID
- 配置的类型(客户端/公共/服务器)
- 配置选项所属的类别
- 配置选项的名称。
有了这些信息,你可以在你的模式文件夹中的文本文件中添加一行,格式如下:
<modID>.<configtype>.<category1>.<category2>.<configname> = <result>
示例:
forge.client.client.disableStairSlabCulling = false
为了方便起见,我添加了一种减少所需文本量的方法,如果选项位于同一配置/类别中。
示例:
$forge.client.client {
disableStairSlabCulling = false
zoomInMissingModelTextInGui = false
#这是一个注释
}
你可以使用 # 来制作注释。由于配置可能会使用 # 作为值,你不能在同一行中混合注释和实际值。
从 1.6 版本开始,你可以将 Configswapper 应用于任何文件(TOML 格式),而不仅仅是注册到 Forge 的文件。
示例:
customfilepath=config/forge-client.toml
client.disableStairSlabCulling = true
customfilepath 必须是文件的第一行。ModID 和 configtype 已移除,因为它们仅用于标识文件。
文件路径可以从实例根目录或世界根文件夹开始。
有问题?在 Discord 上问我
Config Swapper is a tool designed for switching out a predefined amount of config options. Useful for changing game modes.
It does this by finding and changing the Strings in the actual config file.
This means it should be compatible with most mods, even if they implement some form of custom config (only configs in TOML format are supported at this time).
Config Swapper adds a command to change config "/mode <modename>" and also a file called mode.json with the current mode in the root directory of the instance.
The mode in the mode.json gets applied to the game on launch in order to support pack updates.
Whether a specific config options requires a restart depends on the individual mods. Contact the specific mod developer if you need it.
The /mode command also runs a /reload to make sure the player doesn't forget to.
Please keep in mind that Configswapper cannot revert a mode in any way. As such all config changes need to the specified in every mode.
Creating a Config Mode
On initial load, the mod will create a folder in the config folder called "configswapper".
In here, create a folder with your mode name. e.g. "expert".
In this folder use the same folder structure as from the instances root.
e.g. to change values in config/forge-client.toml add a folder called config and a file called forge-client.toml.
Add the category and key + value combination of the config you want to change to the file in the same format as it is in the original.
The simplest way is to copy the original and remove all values to you do not want to change.
For serverconfigs put them into a folder called serverconfig.
Format before 2.0
to add a config change you need to know:
- the mod ID of the mod it is from
- the type of the config (client/common/server)
- the categories the config option is under
- the name of the config option.
With this information add a line into a text file in the folder of your mode with the following format
<modID>.<configtype>.<category1>.<category2>.<configname> = <result>
Example:
forge.client.client.disableStairSlabCulling = false
For convenience, I've added a way to reduce the amount of text needed if the options are in the same config/category
Example:
$forge.client.client {
disableStairSlabCulling = false
zoomInMissingModelTextInGui = false
#this is a comment
}
You can make comments using #. As configs might use # as value, you cannot mix comment and actual value on a line.
Since 1.6 you can apply configswapper to any file (in TOML format) instead of just files registered to forge.
Example:
customfilepath=config/forge-client.toml
client.disableStairSlabCulling = true
The customfilepath needs to be the first line in the file. ModID and configtype are gone, as they are only used to identify the file.
The file path can start at the instance root or at the world's root folder.
Questions? Ask me on Discord
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Config Swapper
- 1.18.2 移植
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧