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
-
# 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")
-
parent: "minecraft:block/stone"
-
# Support identifier include "minecraft:models/item/dirt.json"
-
# Will try to find under the starting path that passed to resource manager. # It's `models/` here include "minecraft:item/dirt.json"
-
# 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#
How to Install Hocon Resource Loader (Mod)
Hocon Resource Loader by settingdust is verified for Fabric, Forge, Quilt across Minecraft versions 1.20, 1.20.1, 1.21 (latest release: 0.5.0, file size: 295 KB). Follow the steps below to install it safely from ModCraft.tv:
- Click the Download button above and select your Minecraft version (1.20, 1.20.1, 1.21) and platform (Fabric, Forge, Quilt).
- Make sure you have the compatible loader or environment installed for Fabric, Forge, Quilt.
- Move the downloaded Hocon Resource Loader file into your Minecraft
.minecraft/modsfolder and launch the game.
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
|
R
0.5.0
|
last yr. | 1 | |||
|
R
0.4.0
|
last yr. | 1 | |||
|
R
0.3.0
|
last yr. | 1 | |||
|
R
0.2.7
|
last yr. | 1 | |||
|
R
0.2.6
|
last yr. | 1 | |||
|
R
0.2.5
|
last yr. | 1 | |||
|
R
0.2.4
|
last yr. | 1 | |||
|
R
0.2.3
|
last yr. | 1 | |||
|
R
0.2.2
|
last yr. | 1 | |||
|
R
0.2.1
|
last yr. | 1 | |||
|
R
0.2.0
|
last yr. | 1 | |||
|
R
0.1.1
|
last yr. | 1 | |||
|
R
0.1.0
|
last yr. | 1 |
- [
2129c7a](https://github.com/SettingDust/HoconResourceLoader/commit/2129c7a54c0949c9979c1f7153f90ec68f431921) - port to 1.21 *(commit by @SettingDust)*
- due to [
5129ee3](https://github.com/SettingDust/HoconResourceLoader/commit/5129ee3419f290a9ccea194dda5f99176dbf8479) - require enable in pack meta for better performance *(commit by @SettingDust)*:
require enable in pack meta for better performance
### :sparkles: New Features
- [
5129ee3](https://github.com/SettingDust/HoconResourceLoader/commit/5129ee3419f290a9ccea194dda5f99176dbf8479) - require enable in pack meta for better performance *(commit by @SettingDust)*
- [
f310962](https://github.com/SettingDust/HoconResourceLoader/commit/f3109628f24944129abd6f5866748eac7c62adad) - resolve var *(commit by @SettingDust)*
- [
6d9dadf](https://github.com/SettingDust/HoconResourceLoader/commit/6d9dadf122c4c9b98f660b81b3c345b8263a5052) - avoid reuse inputstream *(commit by @SettingDust)*
### :wrench: Chores
- [
500f607](https://github.com/SettingDust/HoconResourceLoader/commit/500f607648ae34a1fd25914755f18c79c495c1d2) - **deps**: bump org.danilopianini.gradle-pre-commit-git-hooks *(commit by @dependabot[bot])*
- [
f41c20f](https://github.com/SettingDust/HoconResourceLoader/commit/f41c20fc0b8f57fb50941d3d93a366ac7f66d125) - support array as root *(commit by @SettingDust)*
### :wrench: Chores
- [
1722b0f](https://github.com/SettingDust/HoconResourceLoader/commit/1722b0f6cf54520b0717bca80248341c95d7a446) - **deps**: bump org.danilopianini.gradle-pre-commit-git-hooks *(commit by @dependabot[bot])*
- [
fea9e07](https://github.com/SettingDust/HoconResourceLoader/commit/fea9e07177472096265601fe6e053e9b92ed3ab9) - can't access Result constructor *(commit by @SettingDust)*
- [
f7de453](https://github.com/SettingDust/HoconResourceLoader/commit/f7de453c6368bd682f3dc4d3a9cf4e94e6060f59) - switched to MethodHandle instead of Reflection *(commit by @SettingDust)*
- [
d20fc9e](https://github.com/SettingDust/HoconResourceLoader/commit/d20fc9ef52460f1651dd35d7a1e35dc3a13e17f8) - removewrapForDebugforgetAllResourcesso that support Patched *(commit by @SettingDust)*
- [
dcf1819](https://github.com/SettingDust/HoconResourceLoader/commit/dcf1819aa1610c53debe7a91bcddff1423a383e6) - markResultConstructoras accessible *(commit by @SettingDust)*
### :wrench: Chores
- [
f970a97](https://github.com/SettingDust/HoconResourceLoader/commit/f970a97fc8d51aae96bd0dbe83a0898cb9c3b5d6) - add test file for lang file *(commit by @SettingDust)*
- [
63d74f3](https://github.com/SettingDust/HoconResourceLoader/commit/63d74f334b561af49d63662791ec80ecb498aa27) - crash caused byNamespaceResourceManager$Resulthas no constructors *(commit by @SettingDust)*
- [
204f1c0](https://github.com/SettingDust/HoconResourceLoader/commit/204f1c03bde9cf6ee2997cc08d0eaa46e5795498) - support patch json file with hocon file *(commit by @SettingDust)*
- [
7a1674b](https://github.com/SettingDust/HoconResourceLoader/commit/7a1674ba1a12877ab72b0e41fc4039afbdcd36ea) - using MappingResolver instead of hardcoded *(commit by @SettingDust)*
- [
b807335](https://github.com/SettingDust/HoconResourceLoader/commit/b807335bd3a23ff9a5654bcd35cb901b48cd6cef) - just works *(commit by @SettingDust)* - [
97a5a29](https://github.com/SettingDust/HoconResourceLoader/commit/97a5a2938a7dfcd3af4df3855c21f0efec4c0146) - complete resource includer *(commit by @SettingDust)*
### :bug: Bug Fixes
- [
ca78064](https://github.com/SettingDust/HoconResourceLoader/commit/ca78064f94d28fe697f7c60d57834e7be3daaafa) - runnable on forge and prod fabric *(commit by @SettingDust)*
### :wrench: Chores
- [
da053f3](https://github.com/SettingDust/HoconResourceLoader/commit/da053f33896f69fa12092775771ed3e5f08f4d8c) - **deps**: add hocon dependencies *(commit by @SettingDust)* - [
2729d54](https://github.com/SettingDust/HoconResourceLoader/commit/2729d54392d0269078c08dcde6e778c3de9868b5) - stuffs before publish *(commit by @SettingDust)*