You can find the record in the database using these calculations:
WARNING: Be sure to save a copy of your 'map.sqlite' file!!!
1)First find the general area that you would like to reset (x,y,z)
2)Next convert these node coords to map block coords:
x = int(x/16)
y = int(y/16)
z = int(z/16)
3)Use these x,y,z to get the database index value
db_pos = (z*16777216 + y*4096 + x)
4)Open map.sqlite (you will need a program to do this; Google it or try
http://sourceforge.net/projects/sqlitebrowser/)
5)Execute this SQL statement:
"DELETE BROM blocks WHERE pos = db_pos;"
Be sure to replace 'db_pos' with the number you got in step 3.
6)Repeat as needed.
----------------------------------------------------------
Here is some LUA code that will make an SQL statement for you that will delete everything except for blocks in the defined area. To delete only blocks in the defined area, you just need to remove the word 'NOT' in the SQL statement. (NOTE: this in not a mod. You need the standalone LUA program to run this. (
LUA for Windows)
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- These numbers are node values
x_min = -300
x_max = 300
y_min = -20
y_max = 100
z_min = -300
z_max = 300
x_min = math.floor(x_min / 16)-1
x_man = math.floor(x_man / 16)+1
y_min = math.floor(y_min / 16)-1
y_man = math.floor(y_man / 16)+1
z_min = math.floor(z_min / 16)-1
z_man = math.floor(z_man / 16)+1
function GetBlockInt(x, y, z)
return (z*16777216 + y*4096 + x)
end
sql = "DELETE FROM blocks WHERE pos NOT IN ("
for x = x_min, x_max do
for y = y_min, y_max do
for z = z_min, z_max do
sql = sql .. GetBlockInt(x,y,z)
if x == x_max and y == y_max and z == z_max then
sql = sql .. ")"
else
sql = sql .. ", "
end
end
end
end
f = io.open ("runthis_sql" , "w+")
f:write(sql)
f:close()