Add chatcommands on init time

master
Wuzzy 2019-09-29 11:55:38 +02:00
parent 65e854b8ef
commit 2bd52f3f33
1 changed files with 13 additions and 1 deletions

View File

@ -223,12 +223,21 @@ local function find_biome(pos, biomes)
end
local mods_loaded = false
minetest.register_on_mods_loaded(function()
mods_loaded = true
end)
-- Regiver chat commands
do
minetest.register_chatcommand("findbiome", {
description = S("Find and teleport to biome"),
params = S("<biome>"),
privs = { debug = true, teleport = true },
func = function(name, param)
if not mods_loaded then
return false
end
local player = minetest.get_player_by_name(name)
if not player then
return false, S("No player.")
@ -279,6 +288,9 @@ minetest.register_on_mods_loaded(function()
params = "",
privs = { debug = true },
func = function(name, param)
if not mods_loaded then
return false
end
local biomes
local b = 0
if mg_name == "v6" then
@ -305,4 +317,4 @@ minetest.register_on_mods_loaded(function()
end
end,
})
end)
end