diff --git a/pet.lua b/pet.lua index 8847158..76b4f95 100644 --- a/pet.lua +++ b/pet.lua @@ -153,20 +153,27 @@ function myapi.notpurring(pos) return not purrtime and {} end -local petgroups = minetest.registered_items[""].tool_capabilities.groupcaps.cuddly and {cuddly = 1} or {thumpy = 1} -nodecore.register_craft({ - label = "pet cat", - action = "pummel", - toolgroups = petgroups, - indexkeys = {"group:" .. modname .. "_face"}, - check = function(pos) - return myapi.notpurring(pos) and playernear(pos) - end, - nodes = { - {match = { - groups = {[modname .. "_cat"] = true}, - stacked = false - }} - }, - after = purrstart - }) +local petdef = { + label = "pet cat", + action = "pummel", + indexkeys = {"group:" .. modname .. "_face"}, + check = function(pos) + return myapi.notpurring(pos) and playernear(pos) + end, + nodes = { + {match = { + groups = {[modname .. "_cat"] = true}, + stacked = false + }} + }, + after = purrstart +} +nodecore.register_craft(nodecore.underride({ + toolgroups = minetest.registered_items[""].tool_capabilities.groupcaps.cuddly + and {cuddly = 1} or {thumpy = 1}, + }, petdef)) +nodecore.register_craft(nodecore.underride({ + wield = {groups = {rakey = true}}, + consumewield = 1, + duration = 2 + }, petdef))