1 Commits

Author SHA1 Message Date
a38f37d1ee Enforce checks for ignore
It is `buildable_to` so the standard check didn’t work
2020-10-23 20:37:40 +03:00
2 changed files with 8 additions and 9 deletions

View File

@ -29,6 +29,9 @@ function mesecon.is_mvps_stopper(node, pushdir, stack, stackid)
end end
function mesecon.register_mvps_stopper(nodename, get_stopper) function mesecon.register_mvps_stopper(nodename, get_stopper)
if minetest.registered_nodes[nodename] and minetest.registered_nodes[nodename].buildable_to then
minetest.log("warning", ("Registering a buildable-to node \"%s\" as a mesecon stopper, this is not supported"):format(nodename))
end
if get_stopper == nil then if get_stopper == nil then
get_stopper = true get_stopper = true
end end
@ -71,6 +74,10 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
local np = frontiers[1] local np = frontiers[1]
local nn = minetest.get_node(np) local nn = minetest.get_node(np)
-- Never push into unloaded blocks. Dont try to pull from them, either.
-- TODO: load blocks instead, as with wires.
if nn.name == "ignore" then return nil end
if not node_replaceable(nn.name) then if not node_replaceable(nn.name) then
table.insert(nodes, {node = nn, pos = np}) table.insert(nodes, {node = nn, pos = np})
if #nodes > maximum then return nil end if #nodes > maximum then return nil end
@ -327,10 +334,6 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor)
end end
end end
-- Never push into unloaded blocks. Dont try to pull from them, either.
-- TODO: load blocks instead, as with wires.
mesecon.register_mvps_stopper("ignore")
mesecon.register_mvps_stopper("doors:door_steel_b_1") mesecon.register_mvps_stopper("doors:door_steel_b_1")
mesecon.register_mvps_stopper("doors:door_steel_t_1") mesecon.register_mvps_stopper("doors:door_steel_t_1")
mesecon.register_mvps_stopper("doors:door_steel_b_2") mesecon.register_mvps_stopper("doors:door_steel_b_2")

View File

@ -3,11 +3,7 @@ minetest.register_node("mesecons_noteblock:noteblock", {
tiles = {"mesecons_noteblock.png"}, tiles = {"mesecons_noteblock.png"},
is_ground_content = false, is_ground_content = false,
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
on_punch = function(pos, node, puncher) -- change sound when punched on_punch = function(pos, node) -- change sound when punched
if minetest.is_protected(pos, puncher and puncher:get_player_name()) then
return
end
node.param2 = (node.param2+1)%12 node.param2 = (node.param2+1)%12
mesecon.noteblock_play(pos, node.param2) mesecon.noteblock_play(pos, node.param2)
minetest.set_node(pos, node) minetest.set_node(pos, node)