Skip to content

Commit c6db086

Browse files
committed
Allow custom resource pack path in config
1 parent a2fd2ad commit c6db086

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

scripts/dmodels_loader.dsc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dmodels_load_bbmodel:
1010
definitions: model_name
1111
script:
1212
# =============== Prep ===============
13-
- define pack_root data/dmodels/res_pack
13+
- define pack_root <script[dmodels_config].data_key[resource_pack_path]>
1414
- define models_root <[pack_root]>/assets/minecraft/models/item/dmodels/<[model_name]>
1515
- define textures_root <[pack_root]>/assets/minecraft/textures/dmodels/<[model_name]>
1616
- define item_validate <item[<script[dmodels_config].data_key[item]>]||null>
@@ -40,8 +40,8 @@ dmodels_load_bbmodel:
4040
- debug error "[DModels] Can't load bbmodel for '<[model_name]>' - file has no elements?"
4141
- stop
4242
# =============== Pack validation ===============
43-
- if !<server.has_flag[data/dmodels/res_pack/pack.mcmeta]>:
44-
- run dmodels_multiwaitable_filewrite def.key:<[model_name]> def.path:data/dmodels/res_pack/pack.mcmeta def.data:<map.with[pack].as[<map[pack_format=8;description=dModels_AutoPack_Default]>].to_json[native_types=true;indent=4].utf8_encode>
43+
- if !<server.has_flag[<[pack_root]>/pack.mcmeta]>:
44+
- run dmodels_multiwaitable_filewrite def.key:<[model_name]> def.path:<[pack_root]>/pack.mcmeta def.data:<map.with[pack].as[<map[pack_format=8;description=dModels_AutoPack_Default]>].to_json[native_types=true;indent=4].utf8_encode>
4545
# =============== Textures loading ===============
4646
- define tex_id 0
4747
- foreach <[data.textures]||<list>> as:texture:

scripts/dmodels_main.dsc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,6 @@ dmodels_config:
122122
# Using a leather based item is recommended to allow for dynamically recoloring items.
123123
# Leather_Horse_Armor is ideal because other leather armors make noise when equipped.
124124
item: leather_horse_armor
125+
# You can set the resource pack path to a custom path if you want.
126+
# Note that the default Denizen config requires this path start under "data/"
127+
resource_pack_path: data/dmodels/res_pack

0 commit comments

Comments
 (0)