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:
@@ -1113,8 +1113,13 @@ if [ -f sprites.json ]; then
|
|||||||
| gsub("\\t";",")
|
| gsub("\\t";",")
|
||||||
' sprites.json > scratch_files/sprites.csv
|
' sprites.json > scratch_files/sprites.csv
|
||||||
|
|
||||||
|
function write_id_hash () {
|
||||||
|
local entry_hash=$(echo -n "${1}" | md5sum | head -c 7)
|
||||||
|
echo "${2},${entry_hash}" >> "${4}"
|
||||||
|
}
|
||||||
|
|
||||||
while IFS=, read -r predicate icon
|
while IFS=, read -r predicate icon
|
||||||
do write_hash "${predicate}" "${icon}" "scratch_files/sprite_hashes.csv" &
|
do write_id_hash "${predicate}" "${icon}" "scratch_files/sprite_hashes.csv" &
|
||||||
done < scratch_files/sprites.csv > /dev/null
|
done < scratch_files/sprites.csv > /dev/null
|
||||||
|
|
||||||
jq -cR 'split(",")' scratch_files/sprite_hashes.csv | jq -s 'map({("gmdl_" + .[1]): {"textures": .[0]}}) | add' > scratch_files/sprite_hashmap.json
|
jq -cR 'split(",")' scratch_files/sprite_hashes.csv | jq -s 'map({("gmdl_" + .[1]): {"textures": .[0]}}) | add' > scratch_files/sprite_hashmap.json
|
||||||
|
|||||||
Reference in New Issue
Block a user