moved talk_tool craft receipe into talk_tool.lua
This commit is contained in:
parent
ecf0d0f95f
commit
28bbed66e4
@ -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
|
-- make sure it gets called once now and in the future whenever yl_speak_up is reloaded
|
||||||
-- (via /npc_talk_reload)
|
-- (via /npc_talk_reload)
|
||||||
yl_speak_up.register_on_reload(npc_talk.enable_talk_to_animals, "npc_talk.enable_talk_to_animals()")
|
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
|
end
|
||||||
|
@ -27,3 +27,24 @@ npc_talk.talk_tool = function(itemstack, player, pointed_thing)
|
|||||||
|
|
||||||
return nil -- no item shall be removed from inventory
|
return nil -- no item shall be removed from inventory
|
||||||
end
|
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"},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user