JsonPatcher
JsonPatcher 是一个模组,允许你在不覆盖的前提下修改数据包和资源包中的 JSON 文件。 这主要对模组开发者和整合包制作者有用,但玩家也可用它来修改自己的包。
V2 免责声明
JsonPatcher v2 目前处于测试阶段。V2 引入了一系列新功能,包括针对模组和整合包的全局补丁。 v2 的文档位于 jsonpatcher-docs.mattidragon.dev。 不过,文档尚不完整且部分已过时。 在某些情况下,查阅旧版 Wiki 可能是更好的选择。
使用方法
Gradle 依赖(适用于模组开发者)
你可以像这样将 jsonpatcher 添加到你的模组构建脚本中:
repositories {
maven {
url 'https://jitpack.io'
}
}
dependencies {
modImplementation(include("com.github.mattidragon:jsonpatcher:${jsonpatcher_version}"))
}
要开始使用 jsonpatcher,只需在你的数据包的 data/<namespace>/jsonpatch 目录或资源包的 assets/<namespace>/jsonpatch 目录中创建一个扩展名为 .jsonpatch 的文件即可。
你需要以如下形式的 @version 元标签开始你的补丁。
这将让 jsonpatcher 知道你的补丁适用于此版本。
未来你可能可以通过更多方式来选择版本。
@version "1"
接下来,你需要选择要修补的文件。
这是通过 @target 元标签完成的。所有元标签都遵循 JSON 格式。
你可以使用字符串选择单个文件,使用对象进行更广泛的匹配,
或使用数组进行多次匹配。如果数组中的任何选择器匹配,补丁就会生效。
现在你可以开始修改目标文件了。补丁文件使用类 C 语法。
你可以使用 $ 访问目标文件的内容。它可以像变量一样使用,
或者你也可以直接在它后面放置你想访问的属性。
有关该语言的更多信息,请参阅 Wiki。
JsonPatcher
JsonPatcher is a mod that allows you to modify json files in datapacks and resourcepacks without overriding them. This is primarily useful for mod developers and pack makers, but can also be used by players to modify their own packs.
V2 Disclaimer
JsonPatcher v2 is currently in beta. V2 introduces a bunch of new features including global patches for mods and modpacks. Documentation for v2 is available at jsonpatcher-docs.mattidragon.dev. The documentation is however quite incomplete and partially outdated. For some cases it might be best to consult the old wiki instead.
Usage
Gradle dependency (for mod developers)
You can add jsonpatcher to your mods buildscript like this:
repositories {
maven {
url 'https://jitpack.io'
}
}
dependencies {
modImplementation(include("com.github.mattidragon:jsonpatcher:${jsonpatcher_version}"))
}
To begin using jsonpatcher, just create a file with the .jsonpatch extension
in the data/<namespace>/jsonpatch directory of your datapack
or assets/<namespace>/jsonpatch directory of your resourcepack.
You'll want to begin your patch with a @version meta tag like this.
This will let jsonpatcher know that your patch will work with this version.
In the future you may be able to select a version in more ways.
@version "1"
Next you'll want to select the files you want to patch.
This is done with the @target meta tag. All meta tags follow a json format.
You can either select a single file with a string, use an object for broader selections,
or use an array for multiple selections. If any selector in the array matches, the patch will apply.
Now you can begin modifying the target file. The patch files use a c-like syntax.
You can access the target files contents with $. It can be used like a variable,
or you can put the property you want to access directly after it.
For more info on the language, see the wiki.
下载 JsonPatcher
下载 JsonPatcher
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 JsonPatcher
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- 更新语言版本至 2.0.0-beta.9,修复了阻止世界加载的关键错误
- 移植至 26.3
- 新增
events库,用于与 Fabric 事件交互- 未来可能会添加自定义事件
- 新增
hotswap_events配置选项,可在快速事件和开发者便利之间切换
- 新增
mod:jsonpatcher:async库- 提供互斥锁和读写锁,供共享库使用
- 大量内部重命名以匹配正确的术语
- 会反映在全局目录中
- 新增全局变量
ctx,包含执行环境的上下文信息 - 默认补丁超时时间现在为 500ms,而非 100ms
- 这应在 JIT 优化补丁较慢的情况下提供更多余地
- 将补丁超时时间设置为负数现在将禁用它
- 这对 JsonPatcher 本身的开发非常有用,但任何人都可以使用
- 更换为新的、更简洁的图标
- 新增功能标志系统,用于切换补丁组
- 新增 RecipePatcher,一组内置的数据包补丁,有助于批量修补配方
- 需要启用功能标志以避免在未使用时修补所有配方
- 易于扩展至自定义配方类型
- 更新语言版本至 2.0.0-beta.9,带来各种修复和改进
- 修复了 JsonPatcher 无法正确设置其数据目录的问题
- 更新语言文件至 Beta 8
- 修复了若干小问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
AE2:一款流行的自动化与存储模组
评论 0
登录后参与评分
还没有评论,来抢沙发吧