Document DNTs
This commit is contained in:
parent
ed9002e519
commit
9b5db81149
@ -11,7 +11,7 @@ local math_random
|
||||
--- itemnames: {"mod:itemname", "group:name"}
|
||||
--- interval: integer,
|
||||
--- chance: integer,
|
||||
--- func: function(stack, data) end
|
||||
--- action: function(stack, data) end
|
||||
-- Data:
|
||||
--- {pos, node}
|
||||
--- {player, inv, list, slot}
|
||||
|
@ -7,6 +7,13 @@ local string_format
|
||||
|
||||
-- Active Block Modifiers, meet Delayed Node Triggers.
|
||||
|
||||
-- Definition:
|
||||
--- mname: "modname:technicalname"
|
||||
--- nodenames: {"mod:itemname", "group:name"}
|
||||
--- time: float (optional),
|
||||
--- loop: boolean,
|
||||
--- action: function(pos, node) end
|
||||
|
||||
nodecore.registered_dnts = {}
|
||||
|
||||
local grouppref = "group:"
|
||||
@ -38,7 +45,7 @@ end
|
||||
|
||||
function nodecore.register_dnt(def)
|
||||
if not def.name then return error("dnt name required") end
|
||||
if not def.name then return error("dnt action required") end
|
||||
if not def.action then return error("dnt action required") end
|
||||
if nodecore.registered_dnts[def.name] then
|
||||
return error(string_format("dnt %q already registered", def.name))
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user