From 99d6aeb35ec14a9c06e38955c6cb073b4914d6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Wed, 19 Aug 2020 23:38:48 +0200 Subject: [PATCH] Mine: fix is_block_precious --- turtles/mine.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/turtles/mine.lua b/turtles/mine.lua index aa5b416..a49a936 100644 --- a/turtles/mine.lua +++ b/turtles/mine.lua @@ -240,11 +240,14 @@ function is_block_precious(block) } if block then for id, refblock in ipairs(WORTHY_BLOCKS) do - if block['name'] == refblock['name'] then - if (refblock['state_type'] - and block['state'] and block['state']['type'] - and block['state']['type'] == refblock['state_type']) then + if block.name == refblock.name then + if refblock.state_type then + if (block.state and block.state.type + and block.state.type == refblock.state_type) then return true + end + else + return true end end end