Not Just Jason
Not Just Jason(简称 NotJustJson 或 NJJ)是一个实用型模组,允许使用除 JSON 以外的其他数据类型来定义新的数据包元素。
如果检测到同一文件以不同的文件格式被定义,它将记录错误,并使用最后匹配的那个格式。
目前支持的文件类型:
| 类型 |
版本 |
后缀 |
| TOML |
v1.0.0 |
.toml |
| XML |
1.0 |
.xml |
| YAML |
1.2 |
.yaml |
| JSON |
2020-12 |
.json |
| NBT |
19133 |
.nbt |
| SNBT |
19133 |
.snbt |
如何使用 NJJ?
用法相当简单:你可以像使用 json 文件一样使用其他格式的文件。要定义一个新的生物群系,
你需要添加一个名为 data/<namespace>/worldgen/biome/<filename><suffix> 的新文件,
例如 data/test/worldgen/biome/new_biome.toml 或 data/test/worldgen/biome/new_biome.xml。
常见问题
这些文件格式支持哪些元素?
除结构(位于 data/<namespace>/structures/ 中的生成 .nbt 文件)外,所有条目均可在这些文件格式中使用。
如果有任何元素类型无法正常工作,请在问题追踪器上报告。
这些文件类型能与其他模组兼容吗?
是的,只要它们使用 Forge 的数据包注册表系统,或者它们的 ReloadableResourceListener 实现了 SimpleJsonReloadListener,大多数模组都应该是这种情况。
再次提醒,请在问题追踪器中报告无法正常工作的模组。
我可以添加新的文件类型吗?
当然可以。你可以提交 PR 来添加新文件类型,使其成为该模组的一部分,或者创建一个依赖于此模组的附加模组(add-on)。
要添加新的文件类型,只需在 FileTypeRegistry 中注册一个新的 FileType 即可。所需的 ResourceKey 可以在 FileType#REGISTRY 中找到。
ID 冲突如何处理?
如果你拥有相同的文件类型但后缀不同,可能会出现 ID 冲突。例如,/data/<namespace>/worldgen/biome 目录可能如下所示:
.../test.json
.../test.toml
.../test.xml
在发生 ID 冲突的情况下,加载器可以加载所有这些文件,因为它们的 ID 都是相同的。因此,它只会使用按字母顺序排在最后的那个后缀的文件。
在这种情况下,它会使用 .../test.xml 文件。
不同的后缀可以互相覆盖吗?
是的,你也可以用 test.toml 文件覆盖 test.json 文件,前提是它们位于不同的数据包中。
有关同一数据包的處理,请参阅上面的常见问题解答。
如果我在使用此模组时遇到困难,可以在哪里寻求帮助?
加入我们的 Discord(推荐)或在 CurseForge 上发表评论。请勿使用 GitHub Issue 跟踪器,它仅用于最终错误报告。
Not Just Jason
Not Just Jason (NotJustJson or NJJ in short) is a utility mod, which allows to use other data types then json to define new data-pack elements.
It will log an error if it detects one file being defined in different file types and is going to use the last match.
Currently, these file types are supported:
| Type |
Version |
Suffix |
| TOML |
v1.0.0 |
.toml |
| XML |
1.0 |
.xml |
| YAML |
1.2 |
.yaml |
| JSON |
2020-12 |
.json |
| NBT |
19133 |
.nbt |
| SNBT |
19133 |
.snbt |
How to use NJJ?
The usage is fairly simple: One can use the other file typed just as json is used. To define a new biome,
one would add a new file called data/<namespace>/worldgen/biome/<filename><suffix>,
for example data/test/worldgen/biome/new_biome.toml or data/test/worldgen/biome/new_biome.xml.
FAQ
Which elements can I use with these file types?
All entries, except structures (the generated .nbt files in data/<namespace>/structures/), can be used with these file types.
Please report all element types, which do not work on the issue tracker
Do these file types work with other mods?
Yes, as long as they either use Forge's data-pack registries system or their ReloadableResourceListeners implement SimpleJsonReloadListener,
which should be the case for most mods.
Again, please report mods which do not work on the issue tracker.
Can I add new file types?
Yes, of course. You can either PR the new file type and they may become part of the mod, or you create an add-on mod which depends on this one.
All you have to do to add a new file type is to register a new FileType in the FileTypeRegistry. The required ResourceKey can be found in FileType#REGISTRY.
How is an ID conflict handled?
An ID Conflict might be the case if you have the same file type, but different suffixes. For example, the /data/<namespace>/worldgen/biome directory might look like this:
.../test.json
.../test.toml
.../test.xml
In case of an ID Conflict, the loader can load all of them, because all their ID would be identical. Therefore, it just uses the alphabetically last suffixed one.
It would use the .../test.xml file in this case.
Can different suffixes override each other?
Yes, you can also override a test.json file with a test.toml one, assuming they're in different data-packs.
For same data-pack handling see the above FAQ.
Where can I get help if I struggle with this mod?
Join our discord (preferred) or write a comment on CurseForge. Please do NOT use the GitHub issue tracker, it's only used for final bug reports.
评论 0
登录后参与评分
还没有评论,来抢沙发吧