diff --git a/nodes/bus.lua b/nodes/bus.lua index 9007448..133d2b0 100644 --- a/nodes/bus.lua +++ b/nodes/bus.lua @@ -231,6 +231,11 @@ minetest.register_node("holostorage:external_storage_bus", { meta:set_string("inv_name", "") end, after_dig_node = holostorage.network.clear_networks, + on_destruct = function (pos) + local node = minetest.get_node(pos) + local front = holostorage.front(pos, node.param2) + minetest.forceload_free_block(front) + end, holostorage_run = function (pos, _, controller) local node = minetest.get_node(pos) local meta = minetest.get_meta(pos) @@ -242,6 +247,7 @@ minetest.register_node("holostorage:external_storage_bus", { local front_inv = front_meta:get_inventory() if front_inv:get_list("main") then local pos_str = minetest.pos_to_string(front) + minetest.forceload_block(front) meta:set_string("infotext", "Serving Inventory at "..pos_str) meta:set_string("inv_pos", pos_str) meta:set_string("inv_name", "main") diff --git a/nodes/common.lua b/nodes/common.lua index eb8a8d2..90a6f97 100644 --- a/nodes/common.lua +++ b/nodes/common.lua @@ -36,7 +36,11 @@ function holostorage.helpers.grid_refresh(pos, n, controller) end function holostorage.front(pos, fd) - local front = minetest.facedir_to_dir(fd) + local back = minetest.facedir_to_dir(fd) + local front = {} + for i, v in pairs(back) do + front[i] = v + end front.x = front.x * -1 + pos.x front.y = front.y * -1 + pos.y front.z = front.z * -1 + pos.z