Go to file
Aftermoth bfdf3efcf1 Update init.lua
Fixed timing bug. Change to get_us_time wasn't thorough.
2016-05-22 08:23:43 +12:00
README.md Add text and link for nuafan 2016-04-25 12:38:07 +12:00
description.txt Added files via upload 2016-04-19 17:44:40 +12:00
init.lua Update init.lua 2016-05-22 08:23:43 +12:00
mod.conf Added files via upload 2016-04-19 17:44:40 +12:00

README.md

Minetest mod: nua

==== Node Update Alerts ====

USAGE:

To raise a normal alert from any position:

nua.event(eventpos)

To receive an alert:

minetest.get_meta(receivernodepos):set_string("on_nbr_update","modname.functionname")

where, modname.functionname = function(receiverpos, eventpos)

Typically, a nua-aware node will have registration code like:

on_construct = function(p)
	local m=minetest.get_meta(p)
	m:set_string("on_nbr_update","zigmod.zag")
	nua.event(p)
end,
after_destruct = function(p,o)
	nua.event(p)
end,

NOTES: "on_nbr_update" is generically named so the interface is equally usable by alternative alert mods.

EXTENSION: Only nua-aware mods can use this mod. Another mod, nuafan, adds nua-support to nodes from nua-ignorant mods as well. https://github.com/Aftermoth/nuafan


Copyright (C) 2016 Aftermoth, Zolan Davis

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3 of the License.

http://www.gnu.org/licenses/lgpl-2.1.html