diff --git a/logic/access_point_formspec.lua b/logic/access_point_formspec.lua index 14fe1fd..614a2b5 100644 --- a/logic/access_point_formspec.lua +++ b/logic/access_point_formspec.lua @@ -462,3 +462,7 @@ function logistica.access_point_on_dug(pos) logistica.access_point_on_player_leave(playerName) end end + +function logistica.access_point_is_player_using_ap(playerName) + return accessPointForms[playerName] ~= nil +end diff --git a/util/compat_mcl.lua b/util/compat_mcl.lua index ec92543..a1d06b5 100644 --- a/util/compat_mcl.lua +++ b/util/compat_mcl.lua @@ -53,3 +53,15 @@ logistica.itemstrings = { lava_source = mcl and "mcl_core:lava_source" or "default:lava_source", paper = mcl and "mcl_core:paper" or "default:paper" } + +-- function overrides +if mcl_crafting_table and mcl_crafting_table.has_crafting_table and type(mcl_crafting_table.has_crafting_table) == "function" then + local has_crafting_table_orig = mcl_crafting_table.has_crafting_table + mcl_crafting_table.has_crafting_table = function(player) + if logistica.access_point_is_player_using_ap(player:get_player_name()) then + return true + else + return has_crafting_table_orig(player) + end + end +end