2020-05-29 14:22:47 -07:00
local S = minetest.get_translator ( " arena_lib " )
function ARENA_LIB_EDIT_PRECHECKS_PASSED ( sender , arena , skip_enabled )
-- se non esiste l'arena, annullo
if arena == nil then
minetest.chat_send_player ( sender , minetest.colorize ( " #e6482e " , S ( " [!] This arena doesn't exist! " ) ) )
return end
-- se non è disabilitata, annullo
if arena.enabled and not skip_enabled then
minetest.chat_send_player ( sender , minetest.colorize ( " #e6482e " , S ( " [!] You must disable the arena first! " ) ) )
return end
-- se è in modalità edit, annullo
if arena_lib.is_arena_in_edit_mode ( arena.name ) then
local p_name_inside = arena_lib.get_player_in_edit_mode ( arena.name )
2020-07-01 05:47:23 -07:00
minetest.chat_send_player ( sender , minetest.colorize ( " #e6482e " , S ( " [!] There must be no one inside the editor of the arena to perform this command! (now inside: @1) " , p_name_inside ) ) )
2020-05-29 14:22:47 -07:00
return end
return true
end
2020-11-23 05:10:13 -08:00
2022-01-07 15:11:22 -08:00
function AL_property_to_string ( property )
2020-11-23 05:10:13 -08:00
2022-01-07 15:11:22 -08:00
if type ( property ) == " string " then
return " \" " .. property .. " \" "
elseif type ( property ) == " table " then
return tostring ( dump ( property ) ) : gsub ( " \n " , " " )
2020-11-23 05:10:13 -08:00
else
2022-01-07 15:11:22 -08:00
return tostring ( property )
2020-11-23 05:10:13 -08:00
end
end
2022-01-07 14:14:41 -08:00
2022-01-11 14:44:53 -08:00
2022-01-07 14:14:41 -08:00
----------------------------------------------
-------------ASPETTANDO MINETEST--------------
----------------------------------------------
arena_lib.temp = { }
2022-04-02 15:39:00 -07:00
-- to remove in MT 5.6
2022-01-07 14:14:41 -08:00
function arena_lib . temp . get_sky ( player )
local get_sky = { player : get_sky ( ) }
local p_sky = { }
p_sky.base_color = ( type ( get_sky [ 1 ] ) ~= " table " ) and get_sky [ 1 ] or table.copy ( get_sky [ 1 ] )
p_sky.type = get_sky [ 2 ]
p_sky.sky_color = table.copy ( player : get_sky_color ( ) )
p_sky.textures = table.copy ( get_sky [ 3 ] )
p_sky.clouds = get_sky [ 4 ]
return p_sky
end