diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-04-10 16:04:16 -0700 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-04-10 16:04:16 -0700 |
commit | c80f2534322e0cc74df533c067c8d379508820a0 (patch) | |
tree | a83db3cc814ea4c043cabafb070b263e21323058 /corn.lua | |
parent | 0073de68e759906948e33feb937657eace75c143 (diff) |
Properly add dig handlers for these 2 corn tops.
Diffstat (limited to 'corn.lua')
-rw-r--r-- | corn.lua | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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({ |