This commit is contained in:
number Zero 2017-01-12 00:51:31 +03:00
parent 2eb819add6
commit cae64bf499
2 changed files with 19 additions and 3 deletions

View File

@ -32,20 +32,32 @@ digiline_routing.multiblock.build2 = function(node1, node2, itemstack, placer, p
minetest.set_node(pos, {name = node1, param2 = dir})
minetest.set_node(botpos, {name = node2, param2 = dir})
digiline:update_autoconnect(pos)
digiline:update_autoconnect(botpos)
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack, true
end
local removing_head = false
digiline_routing.multiblock.dig2 = function(pos, node)
if removing_head then
error("Infinite recursion detected")
end
removing_head = true
local dir = minetest.facedir_to_dir(node.param2)
local tail = vector.add(pos, dir)
minetest.swap_node(tail, {name = "air"}) -- not remove_node
minetest.dig_node(tail)
removing_head = false
end
digiline_routing.multiblock.dig2b = function(pos, node)
local dir = minetest.facedir_to_dir(node.param2)
local head = vector.subtract(pos, dir)
minetest.remove_node(head)
if not removing_head then
minetest.dig_node(head)
end
end

View File

@ -72,6 +72,7 @@ minetest.register_node("digiline_routing:splitter", {
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {dig_immediate=2},
node_box = {
type = "fixed",
@ -108,11 +109,14 @@ minetest.register_node("digiline_routing:splitter_b", {
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
pointable = false,
groups = {dig_immediate=2, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {{ -1/32, -31/64, -7/16, 1/32, -29/64, 7/16 }}, -- hidden, but nonempty for the case of some bug
fixed = {},
},
drop = "",
after_destruct = digiline_routing.multiblock.dig2b,
digiline = {
effector = {