From 84b94eb19804484b689cec441e175628fd10335f Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 11 Jan 2014 17:54:00 +0100 Subject: Add forceloading --- builtin/misc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'builtin/misc.lua') 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 -- cgit v1.2.3