feat: add ability to limit amount of crafts at one time
This commit is contained in:
parent
2c90fb1868
commit
d68d7993fa
1 changed files with 5 additions and 0 deletions
|
|
@ -68,6 +68,7 @@ local RECIPES = {
|
||||||
{"minecraft:cobblestone", 2 * 64},
|
{"minecraft:cobblestone", 2 * 64},
|
||||||
},
|
},
|
||||||
addr = CRUSHER_ADDR,
|
addr = CRUSHER_ADDR,
|
||||||
|
limit = 6,
|
||||||
},
|
},
|
||||||
["minecraft:iron_nugget"] = {
|
["minecraft:iron_nugget"] = {
|
||||||
ingredients = {
|
ingredients = {
|
||||||
|
|
@ -115,6 +116,7 @@ local RECIPES = {
|
||||||
{"minecraft:gravel", 2 * 64},
|
{"minecraft:gravel", 2 * 64},
|
||||||
},
|
},
|
||||||
addr = CRUSHER_ADDR,
|
addr = CRUSHER_ADDR,
|
||||||
|
limit = 4,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -209,6 +211,9 @@ end
|
||||||
|
|
||||||
function craftRecipe (ticker, recipe, count)
|
function craftRecipe (ticker, recipe, count)
|
||||||
if count == nil then count = 1 end
|
if count == nil then count = 1 end
|
||||||
|
if recipe.limit ~= nil then
|
||||||
|
count = math.min(count, recipe.limit)
|
||||||
|
end
|
||||||
local createRequest
|
local createRequest
|
||||||
createRequest = function (recipe, i)
|
createRequest = function (recipe, i)
|
||||||
if i == nil then i = 1 end
|
if i == nil then i = 1 end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue