From 2270121d03f0ed10d9d33c4248563784ef285b5d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 14 May 2017 21:24:17 +0200 Subject: [PATCH] Turn farmland to dirt when piston extends above --- mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index 3d2fb0473..dadd7b394 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -81,6 +81,10 @@ local piston_on = function (pos, node) if success then minetest.add_node(pos, {param2 = node.param2, name = pistonspec.onname}) minetest.add_node(np, {param2 = node.param2, name = pistonspec.pusher}) + local below = minetest.get_node({x=np.x,y=np.y-1,z=np.z}) + if below.name == "mcl_farming:soil" or below.name == "mcl_farming:soil_wet" then + minetest.set_node({x=np.x,y=np.y-1,z=np.z}, {name = "mcl_core:dirt"}) + end mesecon:mvps_process_stack(stack) minetest.sound_play("piston_extend", { pos = pos,