mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-07-13 20:50:21 +02:00
Compare commits
2 Commits
6921909100
...
mvps-ignor
Author | SHA1 | Date | |
---|---|---|---|
a38f37d1ee | |||
d356f901a3 |
@ -664,6 +664,7 @@ local function reset_formspec(meta, code, errmsg)
|
||||
code = minetest.formspec_escape(code or "")
|
||||
errmsg = minetest.formspec_escape(tostring(errmsg or ""))
|
||||
meta:set_string("formspec", "size[12,10]"
|
||||
.."style_type[label,textarea;font=mono]"
|
||||
.."background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]"
|
||||
.."label[0.1,8.3;"..errmsg.."]"
|
||||
.."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]"
|
||||
|
@ -29,6 +29,9 @@ function mesecon.is_mvps_stopper(node, pushdir, stack, stackid)
|
||||
end
|
||||
|
||||
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
|
||||
get_stopper = true
|
||||
end
|
||||
@ -71,6 +74,10 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky)
|
||||
local np = frontiers[1]
|
||||
local nn = minetest.get_node(np)
|
||||
|
||||
-- Never push into unloaded blocks. Don’t 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
|
||||
table.insert(nodes, {node = nn, pos = np})
|
||||
if #nodes > maximum then return nil end
|
||||
@ -327,10 +334,6 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor)
|
||||
end
|
||||
end
|
||||
|
||||
-- Never push into unloaded blocks. Don’t 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_t_1")
|
||||
mesecon.register_mvps_stopper("doors:door_steel_b_2")
|
||||
|
Reference in New Issue
Block a user