make pistons not pull unsticky blocks
This commit is contained in:
parent
e3c19c1f46
commit
923b344282
@ -68,15 +68,17 @@ end
|
|||||||
local function piston_off(pos, node)
|
local function piston_off(pos, node)
|
||||||
local pistonspec = minetest.registered_nodes[node.name]._piston_spec
|
local pistonspec = minetest.registered_nodes[node.name]._piston_spec
|
||||||
minetest.swap_node(pos, {param2 = node.param2, name = pistonspec.offname})
|
minetest.swap_node(pos, {param2 = node.param2, name = pistonspec.offname})
|
||||||
piston_remove_pusher (pos, node)
|
piston_remove_pusher(pos, node)
|
||||||
if not pistonspec.sticky then
|
if not pistonspec.sticky then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local dir = -minetest.facedir_to_dir(node.param2)
|
local dir = -minetest.facedir_to_dir(node.param2)
|
||||||
local pullpos = vector.add(pos, vector.multiply(dir, 2))
|
local pullpos = vector.add(pos, vector.multiply(dir, 2))
|
||||||
local meta = minetest.get_meta(pos)
|
if minetest.get_item_group(minetest.get_node(pullpos).name, "unsticky") == 0 then
|
||||||
mcl_pistons.push(pullpos, vector.multiply(dir, -1), PISTON_MAXIMUM_PUSH, meta:get_string("owner"), pos)
|
local meta = minetest.get_meta(pos)
|
||||||
|
mcl_pistons.push(pullpos, vector.multiply(dir, -1), PISTON_MAXIMUM_PUSH, meta:get_string("owner"), pos)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function piston_orientate(pos, placer)
|
local function piston_orientate(pos, placer)
|
||||||
|
@ -99,7 +99,7 @@ minetest.register_node("mcl_farming:wheat", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1, attached_node=1,
|
groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1, attached_node=1,
|
||||||
dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1},
|
dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1, unsticky = 1},
|
||||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||||
_mcl_blast_resistance = 0,
|
_mcl_blast_resistance = 0,
|
||||||
_mcl_fortune_drop = {
|
_mcl_fortune_drop = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user