From 5546dca7825127152558b2982ce47a219456eb34 Mon Sep 17 00:00:00 2001 From: orwell Date: Mon, 24 Mar 2025 22:00:17 +0100 Subject: is_node_loaded: use new function compare_block_status() instead of removed is_block_active() --- advtrains/helpers.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'advtrains/helpers.lua') diff --git a/advtrains/helpers.lua b/advtrains/helpers.lua index 172cf07..e58625f 100644 --- a/advtrains/helpers.lua +++ b/advtrains/helpers.lua @@ -474,7 +474,13 @@ end local active_node_range = tonumber(minetest.settings:get("active_block_range"))*16 + 16 -- Function to check whether node at position(pos) is "loaded"/"active" -- That is, whether it is within the active_block_range to a player -if minetest.is_block_active then -- define function differently whether minetest.is_block_active is available or not +if core.compare_block_status then + -- latest API + function advtrains.is_node_loaded(pos) + return core.compare_block_status(pos, "active") + end +elseif minetest.is_block_active then -- define function differently whether minetest.is_block_active is available or not + -- API added by my PR but later superseded by the above and now removed advtrains.is_node_loaded = minetest.is_block_active else function advtrains.is_node_loaded(pos) -- cgit v1.2.3