diff options
Diffstat (limited to 'builtin/mainmenu/tab_local.lua')
0 files changed, 0 insertions, 0 deletions
![]() |
index : minetest.git | |
modified minetest for gpcfs purposes | gpcf |
aboutsummaryrefslogtreecommitdiff |
#!/usr/bin/python3
# Loads block files from sectors folders into map.sqlite database.
# The sectors folder should be safe to remove after this prints "Finished."
import time, os, sys
try:
import sqlite3
except:
exit('You need to have the Python sqlite3 module.')
path = "../world/"
paths = []
# sectors2 gets to try first
if os.path.isdir(path + 'sectors2/'):
paths.append('sectors2')
if os.path.isdir(path + 'sectors/'):
paths.append('sectors')
if not paths:
exit('Could not find sectors folder at ' + path + 'sectors2/ or ' + path + 'sectors/')
def parseSigned12bit(u):
u = int('0x'+u, 16)
return (u if u < 2**11 else u - 2**12)
def parseSigned16bit(u):
u = int('0x'+u, 16)
return (u if u < 2**15 else u - 2**16)
def int64(u):
while u >= 2**63:
u -= 2**64
while u <= -2**63:
u += 2**64
return u
# Convert sector folder(s) to integer
def getSectorPos(dirname):
if len(dirname) == 8:
# Old layout
x = parseSigned16bit(dirname[:4])