add node gallery
generates a wall of all registered nodes next to the player. chatcommand /gallery
This commit is contained in:
parent
ecc9fb298c
commit
1fc37f505d
|
@ -0,0 +1,7 @@
|
||||||
|
# node gallery
|
||||||
|
|
||||||
|
generates a wall of all registered nodes next to the player
|
||||||
|
|
||||||
|
## Chatcommands
|
||||||
|
|
||||||
|
/gallery - generate the node gallery
|
|
@ -0,0 +1,17 @@
|
||||||
|
local length = 50
|
||||||
|
|
||||||
|
local function generate_gallery(pos)
|
||||||
|
local i=1
|
||||||
|
for n,node in pairs(minetest.registered_nodes) do
|
||||||
|
minetest.set_node(vector.add(pos,vector.new(i % length,math.ceil(i / length),0)),{name=n})
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_chatcommand("gallery",{
|
||||||
|
description="Generates a wall of all registered nodes next to the player",
|
||||||
|
privs={debug=true},
|
||||||
|
func=function(name,p)
|
||||||
|
local pl=minetest.get_player_by_name(name)
|
||||||
|
generate_gallery(vector.add(pl:get_pos(),vector.new(0,0,5)))
|
||||||
|
end})
|
|
@ -0,0 +1 @@
|
||||||
|
name=node_gallery
|
Loading…
Reference in New Issue