介绍
This mod is for using HOCON for resource packs or data packs
HOCON’s syntax is more flexible and supports advanced syntax such as variables and include, which can reduce boilerplate code.
The mod will load any file in packs ends with .hocon with HOCON parser and trick the game to think it’s a json file.
So that it shouldn’t conflict with any packs that already use the json format.
Need to enable in pack.mcmeta lie below:
{
"pack": {
"pack_format": 15,
"description": {
"translate": "settingsun.pack",
"fallback": "Assets of SettingSun"
},
"supported_formats": [15, 22]
},
"hoconresourceloader" : {
"enabled": true
}
}
Advantage of HOCON
includeurl, file (Can be used for resource/data pack config), minecraft resource by identifier- With
include, you can include the origin json file and modify the value instead of edit the whole file. Far more convenient than the JsonPatch - See more on https://github.com/lightbend/config/blob/main/HOCON.md
Examples
The result of the resource pack at https://github.com/SettingDust/HoconResourceLoader/tree/main/mod/run/resourcepacks/test-resources
- https://github.com/SettingDust/HoconResourceLoader/blob/main/mod/run/resourcepacks/test-resources/assets/minecraft/models/item/stone.hocon
# The current directory to read file relative is minecraft run dir.
# `.minecraft` or `.minecraft/versions/{NAME}` dir in commonly
# At here is `{PROJECT_DIR}/mod/run`
include file("dirt.hocon")

- https://github.com/SettingDust/HoconResourceLoader/blob/main/mod/run/resourcepacks/test-resources/assets/minecraft/models/item/dirt.hocon
parent: "minecraft:block/stone"

- https://github.com/SettingDust/HoconResourceLoader/blob/main/mod/run/resourcepacks/test-resources/assets/minecraft/models/item/oak_log.hocon
# Support identifier
include "minecraft:models/item/dirt.json"

- https://github.com/SettingDust/HoconResourceLoader/blob/main/mod/run/resourcepacks/test-resources/assets/minecraft/models/item/oak_wood.hocon
# Will try to find under the starting path that passed to resource manager.
# It's `models/` here
include "minecraft:item/dirt.json"

- https://github.com/SettingDust/HoconResourceLoader/blob/main/mod/run/resourcepacks/test-resources/assets/minecraft/models/item/torch.hocon
# Specifically, include json files won't be resolved to hocon.
# So, you can do patch for the json file and provide the hocon file as json to the game.
include "minecraft:models/item/torch.json"
textures.layer0 = "minecraft:block/soul_torch"

Credit
Icon from https://www.flaticon.com/free-icon/folder_3767084#
常见问题
Hocon Resource Loader 支持哪些 Minecraft 版本?
Hocon Resource Loader 支持 Minecraft Java 版 1.20–1.21,共 3 个版本,可用的加载器:Fabric / Forge / Quilt。下载时注意选择和你游戏版本一致的文件。
Hocon Resource Loader 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
settingdust 的其他作品
查看全部 →Kiwi 🥝
Minecraft 模组开发库
Snow! Real Magic! ⛄
不是魔法类模组。 · 雪的重力与堆积 · 被雪覆盖的方块 · 调整雪的行为
Mod Compat Fixes
修复整合包中几个模组的问题。
lazyyyyy
主要优化大型整合包的游戏启动时间。
评论
登录后评论和评分