-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGenerateLocalLotrTexturesPy.sh
More file actions
48 lines (42 loc) · 1 KB
/
GenerateLocalLotrTexturesPy.sh
File metadata and controls
48 lines (42 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# @(#) LotrSupportInOverviewer:GenerateLocalLotrTexturesPy.sh v1.02 (2016-11-28) / Hubert Tournier
main( )
{
if [ $# != 1 ]
then what ${0} | grep -v "${0}:" | sed "s/^[ ]*//"
echo "Usage: `basename ${0}` path_to_overviewer_textures_py"
exit 1
fi
if [ ! -f "${1}" ]
then echo "FATAL ERROR: Please install Overviewer first (or verify its location in the Makefile)."
exit 2
fi
while true
do echo -n "Path to your Minecraft world level.dat file: "
read LEVEL_DAT_PATH
[ -f "${LEVEL_DAT_PATH}" ] 2>/dev/null && break
done
ShowLocalMinecraftIds.sh -b -m lotr -l "${LEVEL_DAT_PATH}" \
| awk '
BEGIN {
FS=";"
}
/^[0-9]*;01;lotr:tile.*/ {
BlockId[$3] = $1
next
}
/<lotr:tile\..*>/ {
while (match($0, /<lotr[^>]*>/))
{
K = substr($0, RSTART + 1, RLENGTH - 2)
V = BlockId[ K ]
sub(/<lotr[^>]*>/, V)
}
}
{
print
}
' - lotr_textures.py.template \
> lotr_textures.py
}
main $*