a fix so that all sword (and item with sword in their name) are able to craft pumpkin into pumpkin face

master
asl97 2014-04-16 03:03:45 +08:00
parent b32ef86798
commit 7773643c19
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ minetest.register_node(":farming:pumpkin", {
on_punch = function(pos, node, puncher)
local tool = puncher:get_wielded_item():get_name()
if tool and tool == "default:sword_wood" or tool == "default:sword_stone" or tool == "default:sword_steel" then
if tool and string.match(tool, "sword") then
node.name = "farming:pumpkin_face"
minetest.set_node(pos, node)
puncher:get_inventory():add_item("main", ItemStack("farming:pumpkin_seed"))