Add local copy of minetest.find_nodes_in_area.
This commit is contained in:
parent
df5d24104d
commit
86a4ece7d2
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue
Block a user