From cdbeebc68e88eb747b3768bca228a9a717687c9a Mon Sep 17 00:00:00 2001 From: kilbith Date: Sat, 30 Jan 2016 13:14:09 +0100 Subject: [PATCH] Move repairable tools string in top of file --- worktable.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/worktable.lua b/worktable.lua index a277717..a178ef1 100644 --- a/worktable.lua +++ b/worktable.lua @@ -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