From a78c61332203daee3870aa73c0f05c480b646e66 Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 5 Oct 2020 00:27:08 +0400 Subject: [PATCH] Fix slimeblock/piston behavior, https://github.com/kay27/MineClone2/issues/4 --- mods/ITEMS/REDSTONE/mesecons_mvps/init.lua | 8 +++++--- mods/ITEMS/mcl_core/nodes_misc.lua | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua index 9eaceb88d1..20f280a4b6 100644 --- a/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_mvps/init.lua @@ -120,11 +120,13 @@ function mesecon.mvps_get_stack(pos, dir, maximum, all_pull_sticky) while #frontiers > 0 do local np = frontiers[1] local nn = minetest.get_node(np) - + if nn.name == "ignore" then + minetest.get_voxel_manip():read_from_map(np, np) + nn = minetest.get_node(np) + end if not node_replaceable(nn.name) then - + if #nodes >= maximum then return nil end table.insert(nodes, {node = nn, pos = np}) - if #nodes > maximum then return nil end -- add connected nodes to frontiers, connected is a vector list -- the vectors must be absolute positions diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index ca97c2aa6d..f9ede7718c 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -52,6 +52,16 @@ minetest.register_node("mcl_core:slimeblock", { }, _mcl_blast_resistance = 0, _mcl_hardness = 0, + mvps_sticky = function (pos, node) + local connected = {} + if mesecon.rules.alldirs then + for _, r in ipairs(mesecon.rules.alldirs) do + table.insert(connected, vector.add(pos, r)) + end + end + return connected + end, + }) minetest.register_node("mcl_core:cobweb", {