1.7.10 compatibility
This commit is contained in:
@@ -124,12 +124,13 @@ end
|
|||||||
function ChestAdapter:provide(item, qty, slot, direction)
|
function ChestAdapter:provide(item, qty, slot, direction)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
for key,stack in Util.rpairs(self.getAllStacks(false)) do
|
for key,stack in Util.rpairs(self.getAllStacks(false)) do
|
||||||
if stack.id == item.name and
|
if stack.name == item.name and
|
||||||
stack.dmg == item.damage and
|
(not item.damage or stack.damage == item.damage) and
|
||||||
stack.nbt_hash == item.nbtHash then
|
(not item.nbtHash or stack.nbtHash == item.nbtHash) then
|
||||||
|
|
||||||
local amount = math.min(qty, stack.qty)
|
local amount = math.min(qty, stack.qty)
|
||||||
self.pushItemIntoSlot(direction or self.direction, key, amount, slot)
|
if amount > 0 then
|
||||||
|
self.pushItemIntoSlot(direction or self.direction, key, amount, slot)
|
||||||
|
end
|
||||||
qty = qty - amount
|
qty = qty - amount
|
||||||
if qty <= 0 then
|
if qty <= 0 then
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -913,7 +913,7 @@ function listingPage:eventHandler(event)
|
|||||||
if canLearn then
|
if canLearn then
|
||||||
UI:setPage('learn')
|
UI:setPage('learn')
|
||||||
else
|
else
|
||||||
self.notification:error('Missing a crafting chest\nCheck configuration')
|
self.notification:error('Missing a crafting chest or workbench\nCheck configuration')
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif event.type == 'craft' or event.type == 'grid_select_right' then
|
elseif event.type == 'craft' or event.type == 'grid_select_right' then
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ local fileName = args[1] and
|
|||||||
shell.resolve(args[1]) or
|
shell.resolve(args[1]) or
|
||||||
error('Syntax: persist <file name>')
|
error('Syntax: persist <file name>')
|
||||||
|
|
||||||
local c = Util.readFile() or error('Unable to read file')
|
local c = Util.readFile(fileName) or error('Unable to read file')
|
||||||
|
|
||||||
-- ensure it is writable - if not an error is thrown
|
-- ensure it is writable - if not an error is thrown
|
||||||
Util.writeFile(fileName, '')
|
Util.writeFile(fileName, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user