forked from VoxeLibre/VoxeLibre
Button Fixes:
Fix buttons not being able to be placed on ice. Also, fix redstone circuits staying on if an activated button was destroyed indirectly.
This commit is contained in:
parent
e322a9e23a
commit
66854ff7b3
|
@ -66,9 +66,11 @@ local function on_button_place(itemstack, placer, pointed_thing)
|
||||||
groups = def.groups
|
groups = def.groups
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Only allow placement on full-cube solid opaque nodes
|
-- Only allow placement on full-cube solid opaque nodes, and ice!
|
||||||
if (not groups) or (not groups.solid) or (not groups.opaque) or (def.node_box and def.node_box.type ~= "regular") then
|
if (not groups) or (not groups.solid) or (def.node_box and def.node_box.type ~= "regular") or (not groups.ice) then
|
||||||
return itemstack
|
if (not groups.opaque) then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local above = pointed_thing.above
|
local above = pointed_thing.above
|
||||||
|
@ -193,6 +195,10 @@ function mesecon.register_button(basename, description, texture, recipeitem, sou
|
||||||
mesecon.receptor_off(pos, button_get_output_rules(node))
|
mesecon.receptor_off(pos, button_get_output_rules(node))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
on_destruct = function(pos) -- Ensure redstone circuit turns off if button is destroyed
|
||||||
|
local node = minetest.get_node(pos)
|
||||||
|
mesecon.receptor_off(pos, button_get_output_rules(node))
|
||||||
|
end,
|
||||||
|
|
||||||
_mcl_blast_resistance = 0.5,
|
_mcl_blast_resistance = 0.5,
|
||||||
_mcl_hardness = 0.5,
|
_mcl_hardness = 0.5,
|
||||||
|
|
Loading…
Reference in New Issue