diff options
author | Novatux <nathanael.courant@laposte.net> | 2014-01-11 17:54:00 +0100 |
---|---|---|
committer | Novatux <nathanael.courant@laposte.net> | 2014-01-11 17:54:00 +0100 |
commit | 84b94eb19804484b689cec441e175628fd10335f (patch) | |
tree | 2f94c4bc1d9244160af36df8f6560f3c51c5056e /builtin/misc.lua | |
parent | e21b29f4227581162490cc70aaf4009118544f97 (diff) | |
download | minetest-84b94eb19804484b689cec441e175628fd10335f.tar.gz minetest-84b94eb19804484b689cec441e175628fd10335f.tar.bz2 minetest-84b94eb19804484b689cec441e175628fd10335f.zip |
Add forceloading
Diffstat (limited to 'builtin/misc.lua')
-rw-r--r-- | builtin/misc.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/misc.lua b/builtin/misc.lua index fd80aacf6..1d5e146c6 100644 --- a/builtin/misc.lua +++ b/builtin/misc.lua @@ -64,6 +64,16 @@ function minetest.hash_node_position(pos) return (pos.z+32768)*65536*65536 + (pos.y+32768)*65536 + pos.x+32768 end +function minetest.get_position_from_hash(hash) + local pos = {} + pos.x = (hash%65536) - 32768 + hash = math.floor(hash/65536) + pos.y = (hash%65536) - 32768 + hash = math.floor(hash/65536) + pos.z = (hash%65536) - 32768 + return pos +end + function minetest.get_item_group(name, group) if not minetest.registered_items[name] or not minetest.registered_items[name].groups[group] then |