Only Pickaxe is repairable.
Luacheck points out that: ``` Checking src/workbench.lua 1 warning src/workbench.lua:74:2: loop is executed at most once ``` And this is correct, only the pickaxe is actually currently repairable. Returned the code to the previous (working) fashion.
This commit is contained in:
parent
f3aed9acf4
commit
7675d495c4
@ -71,9 +71,10 @@ workbench.defs = {
|
|||||||
-- Tools allowed to be repaired
|
-- Tools allowed to be repaired
|
||||||
function workbench:repairable(stack)
|
function workbench:repairable(stack)
|
||||||
local tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
|
local tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
|
||||||
for i=1, #tools do
|
for _, t in pairs(tools) do
|
||||||
return stack:find(tools[i])
|
if stack:find(t) then return true end
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function workbench:get_output(inv, input, name)
|
function workbench:get_output(inv, input, name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user