aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-24 15:16:49 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-24 15:17:00 +0300
commit558e284e25b5be14b700951269b027ac82a7b3ca (patch)
tree37cd0fff3c22dcacbb7314ba5dc2619ebf2c4ed0 /util
parent5c31445117ea88061dc4ee60e0dec4d11c8c3ed7 (diff)
downloadminetest-558e284e25b5be14b700951269b027ac82a7b3ca.tar.gz
minetest-558e284e25b5be14b700951269b027ac82a7b3ca.tar.bz2
minetest-558e284e25b5be14b700951269b027ac82a7b3ca.zip
Update minetestmapper.py to support ver. 24 and 25
Diffstat (limited to 'util')
-rwxr-xr-xutil/minetestmapper.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/util/minetestmapper.py b/util/minetestmapper.py
index 83ce716e9..9d364e1e6 100755
--- a/util/minetestmapper.py
+++ b/util/minetestmapper.py
@@ -324,7 +324,9 @@ def content_is_air(d):
return d in [126, 127, 254, "air"]
def read_content(mapdata, version, datapos):
- if version >= 20:
+ if version >= 24:
+ return (mapdata[datapos*2] << 8) | (mapdata[datapos*2 + 1])
+ elif version >= 20:
if mapdata[datapos] < 0x80:
return mapdata[datapos]
else:
@@ -387,6 +389,7 @@ def read_mapdata(mapdata, version, pixellist, water, day_night_differs, id_to_na
#print("unknown node: %s/%s/%s x: %d y: %d z: %d block id: %x"
# % (xhex, zhex, yhex, x, y, z, content))
+
# Go through all sectors.
for n in range(len(xlist)):
#if n > 500:
@@ -546,6 +549,14 @@ for n in range(len(xlist)):
if version == 23:
readU8(f) # Unused node timer version (always 0)
+ if version == 24:
+ ver = readU8(f)
+ if ver == 1:
+ num = readU16(f)
+ for i in range(0,num):
+ readU16(f)
+ readS32(f)
+ readS32(f)
static_object_version = readU8(f)
static_object_count = readU16(f)
@@ -578,6 +589,15 @@ for n in range(len(xlist)):
#print(str(node_id)+" = "+name)
id_to_name[node_id] = name
+ # Node timers
+ if version >= 25:
+ timer_size = readU8(f)
+ num = readU16(f)
+ for i in range(0,num):
+ readU16(f)
+ readS32(f)
+ readS32(f)
+
read_mapdata(mapdata, version, pixellist, water, day_night_differs, id_to_name)
# After finding all the pixels in the sector, we can move on to