mcl_devtest/node_gallery/init.lua

18 lines
507 B
Lua
Raw Normal View History

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