1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

- added map generating script

- dropped support for versions older than 2 because of lighting support
This commit is contained in:
Perttu Ahola 2010-11-29 12:16:17 +02:00
parent b326e75baa
commit c18af6e728
4 changed files with 66 additions and 40 deletions

38
genmap.py Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/python
import struct
import random
def getrand():
i = random.randrange(0,2)
if i==0:
return 0
return 254
"""
Map format:
map/sectors/XXXXZZZZ/YYYY
XXXX,YYYY,ZZZZ = coordinates in hexadecimal
fffe = -2
ffff = -1
0000 = 0
0001 = 1
"""
f = open("map/sectors/00000000/ffff", "wb")
# version
f.write(struct.pack('B', 2))
# is_underground
f.write(struct.pack('B', 0))
for i in range(0,16*16*16):
# Material content
f.write(struct.pack('B', getrand()))
# Brightness
f.write(struct.pack('B', 15))
f.close()