From 08775b0cc908c0f3c7e2369076980da7a947531f Mon Sep 17 00:00:00 2001 From: kabou Date: Wed, 2 Mar 2022 15:25:03 +0100 Subject: [PATCH] Add local copy of minetest.find_nodes_in_area. --- mods/ENTITIES/mcl_burning/api.lua | 4 +++- mods/ENTITIES/mcl_burning/init.lua | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_burning/api.lua b/mods/ENTITIES/mcl_burning/api.lua index 5890d8892..8cdeb8b94 100644 --- a/mods/ENTITIES/mcl_burning/api.lua +++ b/mods/ENTITIES/mcl_burning/api.lua @@ -26,10 +26,12 @@ function mcl_burning.get_collisionbox(obj, smaller, storage) end end +local find_nodes_in_area = minetest.find_nodes_in_area + function mcl_burning.get_touching_nodes(obj, nodenames, storage) local pos = obj:get_pos() local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage) - local nodes = minetest.find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames) + local nodes = find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames) return nodes end diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 82410dfdd..3f3d08af1 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -1,15 +1,15 @@ local modpath = minetest.get_modpath(minetest.get_current_modname()) -local pairs = pairs -local get_connected_players = minetest.get_connected_players -local get_item_group = minetest.get_item_group - mcl_burning = { storage = {} } dofile(modpath .. "/api.lua") +local pairs = pairs +local get_connected_players = minetest.get_connected_players +local get_item_group = minetest.get_item_group + minetest.register_globalstep(function(dtime) for _, player in pairs(get_connected_players()) do local storage = mcl_burning.storage[player]