Merge pull request 'add node gallery' (#3) from gallery into master

Reviewed-on: MineClone2/mcl_devtest#3
This commit is contained in:
cora 2022-03-25 21:27:42 +00:00
commit 906f9ab1a2
3 changed files with 25 additions and 0 deletions

7
node_gallery/README.md Normal file
View File

@ -0,0 +1,7 @@
# node gallery
generates a wall of all registered nodes next to the player
## Chatcommands
/gallery - generate the node gallery

17
node_gallery/init.lua Normal file
View File

@ -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})

1
node_gallery/mod.conf Normal file
View File

@ -0,0 +1 @@
name=node_gallery