From 7c74d0bdf3259276721f594432912072f4a53bf8 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Tue, 21 Nov 2023 14:35:51 +1100 Subject: [PATCH] replace `global_exists` with `get_modpath` related: #97 --- init.lua | 2 +- lua_tube.lua | 2 +- pressure_logic/abms.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 21b184d..2c21c84 100644 --- a/init.lua +++ b/init.lua @@ -204,7 +204,7 @@ minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") -- Unified Inventory categories integration -if minetest.global_exists("unified_inventory") and unified_inventory.registered_categories then +if minetest.get_modpath("unified_inventory") and unified_inventory.registered_categories then if not unified_inventory.registered_categories["automation"] then unified_inventory.register_category("automation", { symbol = "pipeworks:lua_tube000000", diff --git a/lua_tube.lua b/lua_tube.lua index 55a84d0..7c02e9e 100644 --- a/lua_tube.lua +++ b/lua_tube.lua @@ -425,7 +425,7 @@ end -- itbl: Flat table of functions to run after sandbox cleanup, used to prevent various security hazards local function get_digiline_send(pos, itbl, send_warning) - if not minetest.global_exists("digilines") then return end + if not minetest.get_modpath("digilines") then return end local chan_maxlen = mesecon.setting("luacontroller_digiline_channel_maxlen", 256) local maxlen = mesecon.setting("luacontroller_digiline_maxlen", 50000) return function(channel, msg) diff --git a/pressure_logic/abms.lua b/pressure_logic/abms.lua index 2675b7c..bf9c2db 100644 --- a/pressure_logic/abms.lua +++ b/pressure_logic/abms.lua @@ -353,7 +353,7 @@ end flowlogic.run_transition_post = function(pos, node) local mesecons_def = minetest.registered_nodes[node.name].mesecons local mesecons_rules = pipeworks.flowables.transitions.mesecons[node.name] - if minetest.global_exists("mesecon") and (mesecons_def ~= nil) and mesecons_rules then + if minetest.get_modpath("mesecons") and (mesecons_def ~= nil) and mesecons_rules then if type(mesecons_def) ~= "table" then pipeworks.logger("flowlogic.run_transition_post() BUG mesecons def for "..node.name.."not a table: got "..tostring(mesecons_def)) else