From ab69c4c5d1af115e6d16c586797449fefaa07d6a Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 10 Mar 2017 00:55:28 -0700 Subject: [PATCH] use item description rather than item name for player-facing text --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 87d2ade..362395e 100644 --- a/init.lua +++ b/init.lua @@ -271,7 +271,13 @@ minetest.register_node("anvil:anvil", { -- tell the player when the job is done if( input:get_wear() == 0 ) then - minetest.chat_send_player( puncher:get_player_name(), S('Your @1 has been repaired successfully.', tool_name)) + local tool_desc + if minetest.registered_items[tool_name] and minetest.registered_items[tool_name].description then + tool_desc = minetest.registered_items[tool_name].description + else + tool_desc = tool_name + end + minetest.chat_send_player( puncher:get_player_name(), S('Your @1 has been repaired successfully.', tool_desc)) return else pos.y = pos.y + item_displacement