summaryrefslogtreecommitdiff
path: root/corn.lua
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-04-10 16:04:16 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2015-04-10 16:04:16 -0700
commitc80f2534322e0cc74df533c067c8d379508820a0 (patch)
treea83db3cc814ea4c043cabafb070b263e21323058 /corn.lua
parent0073de68e759906948e33feb937657eace75c143 (diff)
Properly add dig handlers for these 2 corn tops.
Diffstat (limited to 'corn.lua')
-rw-r--r--corn.lua16
1 files changed, 16 insertions, 0 deletions
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({