30 lines
842 B
Lua
30 lines
842 B
Lua
local MAXINT = 2147483647;
|
|
|
|
minetest.register_chatcommand("map", {
|
|
params = "[<detail>]",
|
|
func = function(name, detail)
|
|
local player = minetest.get_player_by_name(name);
|
|
local pos = player:get_pos();
|
|
|
|
local player_x = tochunk(pos.x);
|
|
local player_y = tochunk(pos.z);
|
|
|
|
if detail == "" then
|
|
detail = MAXINT;
|
|
end
|
|
|
|
minetest.show_formspec(name, "map", cartographer.get_map_formspec(data, tochunk(pos.x), tochunk(pos.z), 40, 40, detail));
|
|
end,
|
|
})
|
|
|
|
-- TODO: Remove before release
|
|
minetest.register_chatcommand("scan", {
|
|
func = function(name)
|
|
local player = minetest.get_player_by_name(name);
|
|
local pos = player:get_pos();
|
|
|
|
local b = minetest.get_biome_data(pos).biome;
|
|
minetest.chat_send_all(minetest.get_biome_name(b));
|
|
end,
|
|
})
|