feat(turtle-utils): add isFuelItem

This commit is contained in:
Guillaume ARM 2024-05-19 23:15:53 +02:00
parent fd72a34ecb
commit 2ee725388a

View File

@ -2,6 +2,18 @@ local turtleUtils = {}
local DEFAULT_IDLE_TIME = 2
turtleUtils.isFuelItem = function(item)
item = item or {}
-- TODO: silent gear coal
if item.name == 'minecraft:stick' or item.name == 'minecraft:coal_coke_block' or item.name == 'immersiveengineering:coke' or item.name == 'silentgear:netherwood_charcoal' or item.name == 'silentgear:netherwood_charcoal_block' then
return true
end
local tags = item.tags or {}
return tags['minecraft:coals'] or tags['minecraft:logs'] or tags['minecraft:planks'] or tags['minecraft:saplings'] or false
end
turtleUtils.getInventory = function(side)
side = side or 'front'
local inv = peripheral.wrap(side)