forked from minetest-mods/areas
Minor cleanup
This commit is contained in:
5
api.lua
5
api.lua
@ -1,6 +1,5 @@
|
||||
local hudHandlers = {}
|
||||
|
||||
|
||||
areas.registered_on_adds = {}
|
||||
areas.registered_on_removes = {}
|
||||
areas.registered_on_moves = {}
|
||||
@ -17,13 +16,11 @@ function areas:registerOnMove(func)
|
||||
table.insert(areas.registered_on_moves, func)
|
||||
end
|
||||
|
||||
|
||||
--- Adds a function as a HUD handler, it will be able to add items to the Areas HUD element.
|
||||
function areas:registerHudHandler(handler)
|
||||
table.insert(hudHandlers, handler)
|
||||
end
|
||||
|
||||
|
||||
function areas:getExternalHudEntries(pos)
|
||||
local areas = {}
|
||||
for _, func in pairs(hudHandlers) do
|
||||
@ -118,7 +115,7 @@ end
|
||||
-- Note that this fails and returns false when the specified area is fully
|
||||
-- owned by the player, but with multiple protection zones, none of which
|
||||
-- cover the entire checked area.
|
||||
-- @param name (optional) Player name. If not specified checks for any intersecting areas.
|
||||
-- @param name (optional) Player name. If not specified checks for any intersecting areas.
|
||||
-- @param allow_open Whether open areas should be counted as if they didn't exist.
|
||||
-- @return Boolean indicating whether the player can interact in that area.
|
||||
-- @return Un-owned intersecting area ID, if found.
|
||||
|
Reference in New Issue
Block a user