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()
|
local ok, block = turtle.inspectDown()
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
turtleUtils.selectItemBy(function(slot)
|
turtleUtils.selectItemBy(turtleUtils.isSeedInSlot)
|
||||||
local item = turtle.getItemDetail(slot, true)
|
|
||||||
return isSeed(item)
|
|
||||||
end)
|
|
||||||
|
|
||||||
turtle.placeDown()
|
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
|
return tags['minecraft:coals'] or tags['minecraft:logs'] or tags['minecraft:planks'] or tags['minecraft:saplings'] or false
|
||||||
end
|
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)
|
turtleUtils.getInventory = function(side)
|
||||||
side = side or 'front'
|
side = side or 'front'
|
||||||
local inv = peripheral.wrap(side)
|
local inv = peripheral.wrap(side)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user