cartographer/commands.lua

30 lines
842 B
Lua
Raw Normal View History

2020-02-16 18:55:07 +01:00
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
2020-03-08 15:06:26 +01:00
minetest.show_formspec(name, "map", cartographer.get_map_formspec(data, tochunk(pos.x), tochunk(pos.z), 40, 40, detail));
2020-02-16 18:55:07 +01:00
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,
})