From 0d7c2c49883a45133541da91f29f4bfee0ea78da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Tue, 23 Mar 2021 12:02:00 +0100 Subject: [PATCH] Fix #1358 for real --- mods/CORE/_mcl_autogroup/init.lua | 5 ++++- mods/ITEMS/mcl_enchanting/groupcaps.lua | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/CORE/_mcl_autogroup/init.lua b/mods/CORE/_mcl_autogroup/init.lua index 75ed4ce2b3..c8475d0bd4 100644 --- a/mods/CORE/_mcl_autogroup/init.lua +++ b/mods/CORE/_mcl_autogroup/init.lua @@ -178,6 +178,10 @@ end -- Add the groupcaps from a field in "_mcl_diggroups" to the groupcaps of a -- tool. local function add_groupcaps(toolname, groupcaps, groupcaps_def, efficiency) + if not groupcaps_def then + return + end + for g, capsdef in pairs(groupcaps_def) do local mult = capsdef.speed or 1 local uses = capsdef.uses @@ -196,7 +200,6 @@ local function add_groupcaps(toolname, groupcaps, groupcaps_def, efficiency) groupcaps[g .. "_dig"] = get_groupcap(g, level > 0, mult, efficiency, uses) end end - return groupcaps end -- Checks if the given node would drop its useful drop if dug by a given tool. diff --git a/mods/ITEMS/mcl_enchanting/groupcaps.lua b/mods/ITEMS/mcl_enchanting/groupcaps.lua index 216457d050..3750295477 100644 --- a/mods/ITEMS/mcl_enchanting/groupcaps.lua +++ b/mods/ITEMS/mcl_enchanting/groupcaps.lua @@ -45,7 +45,7 @@ end -- To make it more efficient it will first check a hash value to determine if -- the tool needs to be updated. function mcl_enchanting.update_groupcaps(itemstack) - if not itemstack:get_tool_capabilities() then + if not itemstack:get_meta():get("tool_capabilities") then return end