Add chests, the beginnings of a machines API, and other things
This commit is contained in:
parent
3720070a28
commit
4d8312b79d
22 changed files with 557 additions and 16 deletions
|
|
@ -46,6 +46,13 @@ function ns.register_node(name, def)
|
|||
alias = name
|
||||
name = "red_glazed_terracotta:"..name
|
||||
end
|
||||
if def.groups then
|
||||
if def.groups.interactable then
|
||||
def.on_rightclick = function(pos, _, p)
|
||||
rgt.players[p:get_player_name()].interacting_with = pos
|
||||
end
|
||||
end
|
||||
end
|
||||
if def._variants then
|
||||
if type(def._variants) == "string" then
|
||||
rgt_world["register_"..def._variants](def)
|
||||
|
|
@ -87,6 +94,15 @@ function ns.register_tool(name, def)
|
|||
end
|
||||
end
|
||||
|
||||
-- Allow nodes to provide a callback to run on activation without
|
||||
-- needing to register a bunch of mostly identical LBMs.
|
||||
minetest.register_lbm {
|
||||
name = ":red_glazed_terracotta:on_activate",
|
||||
nodenames = {"group:run_on_activate"},
|
||||
action = function(pos, node)
|
||||
minetest.registered_nodes[node.name].on_activate(pos)
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
minetest.register_on_joinplayer(function(p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue