summaryrefslogtreecommitdiff
path: root/mesecons/legacy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mesecons/legacy.lua')
-rw-r--r--mesecons/legacy.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesecons/legacy.lua b/mesecons/legacy.lua
index aba2e9b..ad7093a 100644
--- a/mesecons/legacy.lua
+++ b/mesecons/legacy.lua
@@ -1,5 +1,12 @@
-- Un-forceload any forceloaded mapblocks from older versions of Mesecons which
-- used forceloading instead of VoxelManipulators.
+local BLOCKSIZE = 16
+
+-- convert block hash --> node position
+local function unhash_blockpos(hash)
+ return vector.multiply(minetest.get_position_from_hash(hash), BLOCKSIZE)
+end
+
local old_forceloaded_blocks = mesecon.file2table("mesecon_forceloaded")
for hash, _ in pairs(old_forceloaded_blocks) do
minetest.forceload_free_block(unhash_blockpos(hash))