Sokomine wrote:sfan5 wrote:JackGruff wrote:
Could we please have the ability to remove blocks from a region? I'm not talking about making them air,I'm talking about deleting them such that the game regenerates them.
This would be useful to revert an area to its original state.
That is currently not possible using the Lua API
It is possible on the database level. Trouble is: How do you identify those mapblocks you want to be removed/calculated anew? Also, removing them would only work while the game is not running and using that particular database/map.
Well...
- Code: Select all
import sqlite3
def getBlockAsInteger(x, y, z):
return z * 16777216 + y * 4096 + x
conn = sqlite3.connect("map.sqlite")
cur = self.conn.cursor()
post = [(7, 2, -2), (7, 2, -1)] # MapBlock position [ (nodepos.x / 16, nodepos.y / 16, nodepos.z / 16) ]
for pos in post:
cur.execute("DELETE FROM `blocks` WHERE `pos`==?", (getBlockAsInteger(x, y, z), ))