From c80f2534322e0cc74df533c067c8d379508820a0 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Fri, 10 Apr 2015 16:04:16 -0700 Subject: Properly add dig handlers for these 2 corn tops. --- corn.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'corn.lua') diff --git a/corn.lua b/corn.lua index 9224bb0..b74a79b 100644 --- a/corn.lua +++ b/corn.lua @@ -190,6 +190,14 @@ minetest.register_node("crops:corn_top_1", { paramtype = "light", groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, drop = {}, + on_dig = function(pos, node, digger) + local below = {x = pos.x, y = pos.y - 1, z = pos.z} + if not minetest.get_node(below).name == "crops:base_2" then + return + end + minetest.remove_node(below) + minetest.remove_node(pos) + end }) minetest.register_abm({ @@ -216,6 +224,14 @@ minetest.register_node("crops:corn_top_2", { paramtype = "light", groups = { snappy=3,flammable=3,flora=1,not_in_creative_inventory=1 }, drop = {}, + on_dig = function(pos, node, digger) + local below = {x = pos.x, y = pos.y - 1, z = pos.z} + if not minetest.get_node(below).name == "crops:base_2" then + return + end + minetest.remove_node(below) + minetest.remove_node(pos) + end }) minetest.register_abm({ -- cgit v1.2.3