diff --git a/lava-collector b/lava-collector index 527bd6b..88582cc 100644 --- a/lava-collector +++ b/lava-collector @@ -1,12 +1,20 @@ -- vi: ft=lua -- Goal: collect lava using buckets in the nether, deposit the buckets into a fluid transposer that extracts the lava and sends it to a power generator +local function compareItemName(target) + local itemDetail = turtle.getItemDetail() + if itemDetail == nil then + return nil + end + return itemDetail.name == target +end + local function isEmptyBucket() - return turtle.getItemDetail().name == "minecraft:bucket" + compareItemName("minecraft:bucket") end local function isLavaBucket() - return turtle.getItemDetail().name == "minecraft:lava_bucket" + compareItemName("minecraft:lava_bucket") end local function findFirstEmptyBucket()