From 3eaa3c7bfbb69133007cf00188907bd93a0bc043 Mon Sep 17 00:00:00 2001 From: 1F616EMO~nya Date: Sun, 14 Jul 2024 17:49:07 +0800 Subject: [PATCH] Avoid error if battery holder exists but technic not installed (#107) --- nodes/node_battery_holder.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nodes/node_battery_holder.lua b/nodes/node_battery_holder.lua index 5d21b4b..dd1131a 100644 --- a/nodes/node_battery_holder.lua +++ b/nodes/node_battery_holder.lua @@ -67,6 +67,10 @@ minetest.register_node("digtron:battery_holder", { -- Allow all items with energy storage to be placed in the inventory allow_metadata_inventory_put = function(_, listname, _, stack) if listname == "batteries" then + if not minetest.global_exists("technic") then + return 0 + end + local node_name = stack:get_name() -- Allow all items with energy storage from technic mod