]> git.lizzy.rs Git - xdecor.git/commitdiff
Move repairable tools string in top of file
authorkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 30 Jan 2016 12:14:09 +0000 (13:14 +0100)
committerkilbith <jeanpatrick.guerrero@gmail.com>
Sat, 30 Jan 2016 12:14:09 +0000 (13:14 +0100)
worktable.lua

index a2777177d47fb04449a216cbaf818c8019bdaf85..a178ef14c0d6f23f4f9436a0e2b0ccd9a83b0890 100644 (file)
@@ -51,6 +51,12 @@ worktable.defs = {
                            { 0, 8,  0, 8,  8, 8  }}
 }
 
+-- Tools allowed to be repaired.
+worktable.repairable_tools = [[
+       pick, axe, shovel, sword, hoe
+       armor, shield
+]]
+
 function worktable.get_recipe(item)
        if item:find("^group:") then
                if item:find("wool$") or item:find("dye$") then
@@ -298,10 +304,9 @@ end
 function worktable.put(pos, listname, _, stack)
        local stackname = stack:get_name()
        local mod, node = stackname:match("(.*):(.*)")
-       local allowed_tools = "pick, axe, shovel, sword, hoe, armor"
 
        if listname == "tool" and stack:get_wear() > 0 and
-                       allowed_tools:find(stackname:match(":(%w+)")) then
+                       worktable.repairable_tools:find(stackname:match(":(%w+)")) then
                return stack:get_count()
        end
        if (listname == "input" and worktable.allowed(worktable.nodes[mod], node)) or