Duplicate facedir due to weird bug
This commit is contained in:
parent
b478c8e298
commit
ac0f076c37
@ -231,6 +231,11 @@ minetest.register_node("holostorage:external_storage_bus", {
|
|||||||
meta:set_string("inv_name", "")
|
meta:set_string("inv_name", "")
|
||||||
end,
|
end,
|
||||||
after_dig_node = holostorage.network.clear_networks,
|
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)
|
holostorage_run = function (pos, _, controller)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local meta = minetest.get_meta(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()
|
local front_inv = front_meta:get_inventory()
|
||||||
if front_inv:get_list("main") then
|
if front_inv:get_list("main") then
|
||||||
local pos_str = minetest.pos_to_string(front)
|
local pos_str = minetest.pos_to_string(front)
|
||||||
|
minetest.forceload_block(front)
|
||||||
meta:set_string("infotext", "Serving Inventory at "..pos_str)
|
meta:set_string("infotext", "Serving Inventory at "..pos_str)
|
||||||
meta:set_string("inv_pos", pos_str)
|
meta:set_string("inv_pos", pos_str)
|
||||||
meta:set_string("inv_name", "main")
|
meta:set_string("inv_name", "main")
|
||||||
|
@ -36,7 +36,11 @@ function holostorage.helpers.grid_refresh(pos, n, controller)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function holostorage.front(pos, fd)
|
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.x = front.x * -1 + pos.x
|
||||||
front.y = front.y * -1 + pos.y
|
front.y = front.y * -1 + pos.y
|
||||||
front.z = front.z * -1 + pos.z
|
front.z = front.z * -1 + pos.z
|
||||||
|
Loading…
Reference in New Issue
Block a user