From 4ebefe20c921e5ec80f7e95c6f332bf550c92006 Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Tue, 2 Apr 2019 18:04:55 -0400 Subject: updated areas (now using the minetest-mods repo), farming redo, moreblocks, and moreores --- areas/api.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'areas/api.lua') diff --git a/areas/api.lua b/areas/api.lua index 730e96d..8103b84 100644 --- a/areas/api.lua +++ b/areas/api.lua @@ -1,5 +1,23 @@ local hudHandlers = {} + +areas.registered_on_adds = {} +areas.registered_on_removes = {} +areas.registered_on_moves = {} + +function areas:registerOnAdd(func) + table.insert(areas.registered_on_adds, func) +end + +function areas:registerOnRemove(func) + table.insert(areas.registered_on_removes, func) +end + +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) @@ -141,4 +159,3 @@ function areas:canInteractInArea(pos1, pos2, name, allow_open) -- intersecting areas and they are all owned by the player. return true end - -- cgit v1.2.3