refactor(inferium-harvester): add turtleUtils.isSeedInSlot
This commit is contained in:
parent
702dd4833a
commit
58bb9d6d24
@ -478,10 +478,7 @@ local function replantSeeds(config)
|
||||
local ok, block = turtle.inspectDown()
|
||||
|
||||
if not ok then
|
||||
turtleUtils.selectItemBy(function(slot)
|
||||
local item = turtle.getItemDetail(slot, true)
|
||||
return isSeed(item)
|
||||
end)
|
||||
turtleUtils.selectItemBy(turtleUtils.isSeedInSlot)
|
||||
|
||||
turtle.placeDown()
|
||||
|
||||
|
||||
@ -14,6 +14,13 @@ turtleUtils.isFuelItem = function(item)
|
||||
return tags['minecraft:coals'] or tags['minecraft:logs'] or tags['minecraft:planks'] or tags['minecraft:saplings'] or false
|
||||
end
|
||||
|
||||
turtleUtils.isSeedInSlot = function(slot)
|
||||
local item = turtle.getItemDetail(slot, true)
|
||||
local tags = item and item.tags or {}
|
||||
|
||||
return tags['forge:seeds'] or tags['mysticalagriculture:seeds'] or false
|
||||
end
|
||||
|
||||
turtleUtils.getInventory = function(side)
|
||||
side = side or 'front'
|
||||
local inv = peripheral.wrap(side)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user