From 37d3264999dac18385cc7e43087e216a55b9b46e Mon Sep 17 00:00:00 2001 From: kepler155c Date: Wed, 7 Mar 2018 22:43:50 -0500 Subject: [PATCH] 1.7.10 compatibility --- apis/inventoryAdapter.lua | 2 +- apis/meAdapter.lua | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apis/inventoryAdapter.lua b/apis/inventoryAdapter.lua index 745f23d..c5d65ae 100644 --- a/apis/inventoryAdapter.lua +++ b/apis/inventoryAdapter.lua @@ -6,7 +6,7 @@ function Adapter.wrap(args) 'chestAdapter18', -- adapters for version 1.7 - --'meAdapter', + 'meAdapter', 'chestAdapter', } diff --git a/apis/meAdapter.lua b/apis/meAdapter.lua index 0d37434..9f85101 100644 --- a/apis/meAdapter.lua +++ b/apis/meAdapter.lua @@ -224,6 +224,18 @@ function MEAdapter:provide(item, count, slot, direction) end) end +function MEAdapter:eject(item, qty, direction) + if not _G.turtle then + error('Only a turtle can eject') + end + + local s, m = pcall(function() + self:provide(item, qty) + _G.turtle.emptyInventory() + end) + return s, m +end + function MEAdapter:insert(slot, count) local s, m = pcall(function() self.pullItem(self.direction, slot, count) end) if not s and m then