From 1ba1d13fccf56dc6571cbc228e1048f2a2e7995d Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Mon, 4 Feb 2019 20:21:33 -0500 Subject: [PATCH] Craft eggcorn dirt instead of abming it. --- mods/nc_tree/cultivation.lua | 22 ++++++++++------------ mods/nc_tree/depends.txt | 1 + 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mods/nc_tree/cultivation.lua b/mods/nc_tree/cultivation.lua index 79d49bab..0e81f273 100644 --- a/mods/nc_tree/cultivation.lua +++ b/mods/nc_tree/cultivation.lua @@ -35,18 +35,16 @@ local epname = modname .. ":eggcorn_planted" minetest.register_node(epname, nodecore.underride({drop = ldname}, minetest.registered_nodes[ldname])) -nodecore.register_limited_abm({ - label = "EggCorn Planting", - nodenames = {modname .. ":eggcorn"}, - interval = 2, - chance = 2, - action = function(pos, node) - local above = {x = pos.x, y = pos.y + 1, z = pos.z} - if minetest.get_node(above).name ~= ldname then return end - minetest.remove_node(pos) - minetest.set_node(above, {name = epname}) - minetest.check_single_for_falling(above) - end +nodecore.register_craft({ + normal = {y = 1}, + nodes = { + {match = "nc_terrain:dirt_loose", replace = "air"}, + { + y = -1, + match = modname .. ":eggcorn", + replace = modname .. ":eggcorn_planted" + }, + } }) nodecore.register_limited_abm({ diff --git a/mods/nc_tree/depends.txt b/mods/nc_tree/depends.txt index 7d5897af..57f3c39d 100644 --- a/mods/nc_tree/depends.txt +++ b/mods/nc_tree/depends.txt @@ -1,3 +1,4 @@ nc_api +nc_api_craft nc_terrain nc_fire? \ No newline at end of file