From 044a91fcd59ad4ab1dcd95351d2aaa9a17957760 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 25 Aug 2024 09:48:03 +0200 Subject: [PATCH] Do not crash with tenplus1's hopper mod There are multiple hopper mods and not all of them support the set_extra_container_info function, so the mod crashes now if it is used together with an incompatible hopper mod. To prevent the crash, execute the code for hopper compatibility if hopper and hopper.set_extra_container_info exist and not if a mod named hopper is installed. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 9b1af6b..98490b9 100644 --- a/init.lua +++ b/init.lua @@ -647,7 +647,7 @@ minetest.register_alias("connected_chests:chest_locked_left", minetest.register_alias("connected_chests:chest_locked_right", "default:chest_locked_connected_right") -if minetest.get_modpath("hopper") then +if minetest.global_exists("hopper") and hopper.set_extra_container_info then local function get_inventory(chest_right_pos) local node_right = minetest.get_node(chest_right_pos) if node_right.param2 > 3 then