9
0
mirror of https://github.com/Kas-tle/java2bedrock.sh.git synced 2025-12-19 14:59:13 +00:00

Update converter.sh

This commit is contained in:
Kas-tle
2022-12-20 23:37:31 -08:00
committed by GitHub
parent 183d0ea7f4
commit 97299d360d

View File

@@ -152,12 +152,12 @@ then
exit 1 exit 1
fi fi
# ensure the directories that would contain predicate definitions exist # ensure the directory that would contain predicate definitions exists
if test -d "./assets/minecraft/models/item"; then item_folder="./assets/minecraft/models/item/*.json"; fi if test -d "./assets/minecraft/models/item"
if test -d "./assets/minecraft/models/block"; then block_folder="./assets/minecraft/models/block/*.json"; fi then
if [[ -z ${item_folder} ]] && [[ -z ${block_folder} ]] status_message completion "Minecraft namespace item folder found."
then else
status_message error "Invalid resource pack! No item or block folders exist. No predicate definitions be found." status_message error "Invalid resource pack! No item or block folders exist. No predicate definitions be found."
exit 1 exit 1
fi fi
@@ -218,7 +218,7 @@ if contains(":") then sub("\\:(.+)"; "") else "minecraft" end
| to_entries | map( ((.value.geyserID = "gmdl_\(1+.key)") | .value)) | to_entries | map( ((.value.geyserID = "gmdl_\(1+.key)") | .value))
| INDEX(.geyserID) | INDEX(.geyserID)
' ${item_folder} ${block_folder} > config.json || { status_message error "Invalid JSON exists in block or item folder! See above log."; exit 1; } ' "./assets/minecraft/models/item" > config.json || { status_message error "Invalid JSON exists in block or item folder! See above log."; exit 1; }
status_message completion "Initial predicate config generated" status_message completion "Initial predicate config generated"
# get a bash array of all model json files in our resource pack # get a bash array of all model json files in our resource pack