X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=enchanting.lua;h=73754f8cb8a30bfac019345156e9b3d46f629236;hb=522dc7ef39feeff51057226dc184a5c04c6ecf96;hp=d264b1f5bfdf5c437f7f07982398e39fa8e23ee6;hpb=5726d9ba2aabcc52711828c480f4a978ed64993a;p=xdecor.git diff --git a/enchanting.lua b/enchanting.lua index d264b1f..73754f8 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -69,7 +69,7 @@ function enchanting.on_put(pos, listname, _, stack) for k, v in pairs({"axe, pick, shovel", "chestplate, leggings, helmet", "sword", "boots"}) do - if v:match(stack:get_name():match(":(.-)%_")) then + if v:find(stack:get_name():match(":(%w+)")) then enchanting.formspec(pos, k) end end @@ -101,7 +101,7 @@ end local function allowed(tool) for item in pairs(minetest.registered_tools) do - if item:match("enchanted_"..tool) then return true end + if item:find("enchanted_"..tool) then return true end end return false end