sorcery  Artifact [3ad50b0db8]

Artifact 3ad50b0db80c00afd18e6f06c33291b6e667eaadea726f70b2a67f340ad4b246:


-- abuses the engine to provide additional generic features useful to multiple units
local log = sorcery.logger 'global'

minetest.register_lbm {
	name = 'sorcery:activate_nodes';
	label = 'trigger instantiation-time callbacks';
	nodenames = { 'group:sorcery_instantiate' };
	run_at_every_load = true;
	action = function(pos,node)
		local s = minetest.registered_nodes[node.name]._sorcery
		if not s or not s.on_load then
			log.errf('node type "%s" marked for instantiation-time callback, but no callback specified', node.name)
			return
		end

		s.on_load(pos,node)
	end;
}