diff --git a/libs/turtle-utils.lua b/libs/turtle-utils.lua index e48db71..7c09004 100644 --- a/libs/turtle-utils.lua +++ b/libs/turtle-utils.lua @@ -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)