Add local copy of minetest.find_nodes_in_area.

This commit is contained in:
kabou 2022-03-02 15:25:03 +01:00 committed by cora
parent ed9a403d78
commit 08775b0cc9
2 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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]