diff --git a/talk_to_animals.lua b/talk_to_animals.lua index 18b5c42..87ffc3e 100644 --- a/talk_to_animals.lua +++ b/talk_to_animals.lua @@ -42,24 +42,4 @@ if(minetest.get_modpath("mobs_animal")) then -- make sure it gets called once now and in the future whenever yl_speak_up is reloaded -- (via /npc_talk_reload) yl_speak_up.register_on_reload(npc_talk.enable_talk_to_animals, "npc_talk.enable_talk_to_animals()") - - -- The aniamals have too many functions in on_rightclick - they would need new code - -- for talking to them in on_rightclick. - -- As a workaround, you need to wield this tool and punch or right-click them with it. - minetest.register_craftitem("npc_talk:talk_tool", { - description = "Punch a suitable animal (white or red sheep, cow) with this tool to talk to it", - inventory_image = "mobs_magic_lasso.png^mobs_shears.png", - groups = {book = 1}, - on_use = npc_talk.talk_tool, - on_place = npc_talk.talk_tool, - }) - - -- add a suitable craft receipe - minetest.register_craft({ - output = "npc_talk:talk_tool", - recipe = { - {"mobs:shears"}, - {"mobs:lasso"}, - }, - }) end diff --git a/talk_tool.lua b/talk_tool.lua index c01db95..5120554 100644 --- a/talk_tool.lua +++ b/talk_tool.lua @@ -27,3 +27,24 @@ npc_talk.talk_tool = function(itemstack, player, pointed_thing) return nil -- no item shall be removed from inventory end + + +-- The aniamals have too many functions in on_rightclick - they would need new code +-- for talking to them in on_rightclick. +-- As a workaround, you need to wield this tool and punch or right-click them with it. +minetest.register_craftitem("npc_talk:talk_tool", { + description = "Punch a suitable animal (white or red sheep, cow) with this tool to talk to it", + inventory_image = "mobs_magic_lasso.png^mobs_shears.png", + groups = {book = 1}, + on_use = npc_talk.talk_tool, + on_place = npc_talk.talk_tool, +}) + +-- add a suitable craft receipe +minetest.register_craft({ + output = "npc_talk:talk_tool", + recipe = { + {"mobs:shears"}, + {"mobs:lasso"}, + }, +})