From d7c8e4826ff5f4197fe83d4e8fd545d4bd7b0896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Thu, 20 Aug 2020 00:13:19 +0200 Subject: [PATCH] Fix is_block_precious --- turtles/mine.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/turtles/mine.lua b/turtles/mine.lua index 09dfe11..35c4d91 100644 --- a/turtles/mine.lua +++ b/turtles/mine.lua @@ -262,10 +262,13 @@ 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 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