Increase smelt and compost reserves for improved resource management and add trash items for composting
This commit is contained in:
@@ -7,7 +7,7 @@ local POLL_INTERVAL = 2 -- seconds between barrel checks
|
|||||||
local MONITOR_SIDE = "left"
|
local MONITOR_SIDE = "left"
|
||||||
local SCAN_INTERVAL = 120 -- seconds between full background scans
|
local SCAN_INTERVAL = 120 -- seconds between full background scans
|
||||||
local SMELT_INTERVAL = 3 -- seconds between furnace checks
|
local SMELT_INTERVAL = 3 -- seconds between furnace checks
|
||||||
local SMELT_RESERVE = 64 -- keep at least 1 stack of each raw material
|
local SMELT_RESERVE = 128 -- keep at least 2 stacks of each raw material
|
||||||
local DEFRAG_INTERVAL = 600 -- seconds between defrag passes (10 min)
|
local DEFRAG_INTERVAL = 600 -- seconds between defrag passes (10 min)
|
||||||
local COMPOST_INTERVAL = 3 -- seconds between composter checks
|
local COMPOST_INTERVAL = 3 -- seconds between composter checks
|
||||||
local ALERT_INTERVAL = 15 -- seconds between alert re-checks
|
local ALERT_INTERVAL = 15 -- seconds between alert re-checks
|
||||||
@@ -367,10 +367,18 @@ local COMPOSTABLE_SET = {}
|
|||||||
for _, name in ipairs(COMPOSTABLE) do COMPOSTABLE_SET[name] = true end
|
for _, name in ipairs(COMPOSTABLE) do COMPOSTABLE_SET[name] = true end
|
||||||
|
|
||||||
-- Reserve: keep at least this many of each compostable before composting the rest
|
-- Reserve: keep at least this many of each compostable before composting the rest
|
||||||
local COMPOST_RESERVE = 16
|
local COMPOST_RESERVE = 128 -- 2 stacks
|
||||||
local COMPOST_DROPPER = "minecraft:dropper_10"
|
local COMPOST_DROPPER = "minecraft:dropper_10"
|
||||||
local COMPOST_HOPPER = "minecraft:hopper_0"
|
local COMPOST_HOPPER = "minecraft:hopper_0"
|
||||||
|
|
||||||
|
-- Trash items: compostables with zero reserve (always fully composted)
|
||||||
|
local COMPOST_TRASH = {
|
||||||
|
["minecraft:rotten_flesh"] = true,
|
||||||
|
["minecraft:spider_eye"] = true,
|
||||||
|
["minecraft:poisonous_potato"] = true,
|
||||||
|
["minecraft:fermented_spider_eye"] = true,
|
||||||
|
}
|
||||||
|
|
||||||
-------------------------------------------------
|
-------------------------------------------------
|
||||||
-- Crafting recipes (for networked crafting turtle)
|
-- Crafting recipes (for networked crafting turtle)
|
||||||
-- grid: 9 entries mapping to turtle slots 1-3, 5-7, 9-11
|
-- grid: 9 entries mapping to turtle slots 1-3, 5-7, 9-11
|
||||||
@@ -2609,7 +2617,8 @@ local function autoCompost()
|
|||||||
totalInStorage = totalInStorage + src.total
|
totalInStorage = totalInStorage + src.total
|
||||||
end
|
end
|
||||||
|
|
||||||
local available = totalInStorage - COMPOST_RESERVE
|
local reserve = COMPOST_TRASH[itemName] and 0 or COMPOST_RESERVE
|
||||||
|
local available = totalInStorage - reserve
|
||||||
if available > 0 then
|
if available > 0 then
|
||||||
local toFeed = math.min(available, dropperFreeItems)
|
local toFeed = math.min(available, dropperFreeItems)
|
||||||
local fed = 0
|
local fed = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user