diff --git a/inferium-harvester.lua b/inferium-harvester.lua index 4edbebc..28e7e9d 100644 --- a/inferium-harvester.lua +++ b/inferium-harvester.lua @@ -1,9 +1,10 @@ local turtleUtils = require('libs/turtle-utils') local config = require('config/harvesting') -local VERSION = "0.3.0" +local VERSION = "0.3.1" local IDLE_TIME = 2 local MIN_FUEL_NEEDED = (10 + config.firstCropZ + config.length) * 2 +local MIN_FREE_SLOTS_BEFORE_COMPACT = 4 -- UTILS @@ -128,7 +129,9 @@ local function harvestDown() error('turtle cannot place crop') end - turtleUtils.compactInventory() + if turtleUtils.countFreeSlots() < MIN_FREE_SLOTS_BEFORE_COMPACT then + turtleUtils.compactInventory() + end end local function forward()