Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ModApiBase Class Reference

#include <l_base.h>

+ Inheritance diagram for ModApiBase:
+ Collaboration diagram for ModApiBase:

Static Public Member Functions

static ScriptApiBasegetScriptApiBase (lua_State *L)
 
static ServergetServer (lua_State *L)
 
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
 
static EmergeThreadgetEmergeThread (lua_State *L)
 
static IGameDefgetGameDef (lua_State *L)
 
static EnvironmentgetEnv (lua_State *L)
 
static std::string getCurrentModPath (lua_State *L)
 
template<typename T >
static T * getScriptApi (lua_State *L)
 
static bool registerFunction (lua_State *L, const char *name, lua_CFunction func, int top)
 
static void registerClass (lua_State *L, const char *name, const luaL_Reg *methods, const luaL_Reg *metamethods)
 
template<typename T >
static T * checkObject (lua_State *L, int narg)
 
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions.
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
template<>
s16 readParam (lua_State *L, int index)
 
template<>
int readParam (lua_State *L, int index)
 
template<>
float readParam (lua_State *L, int index)
 
template<>
v2s16 readParam (lua_State *L, int index)
 
template<>
v2f readParam (lua_State *L, int index)
 
template<>
v3f readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 
template<>
std::string readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
 
- Static Protected Member Functions inherited from LuaHelper
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
 
template<typename T >
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua state L at index.
 

Member Function Documentation

◆ checkObject()

template<typename T >
static T * ModApiBase::checkObject ( lua_State * L,
int narg )
inlinestatic

Referenced by get_observers(), LuaCamera::getobject(), LuaLocalPlayer::getobject(), InvRef::l_add_item(), LuaItemStack::l_add_item(), ModApiParticles::l_add_particlespawner(), ObjectRef::l_add_pos(), ObjectRef::l_add_velocity(), LuaItemStack::l_add_wear(), LuaItemStack::l_add_wear_by_uses(), LuaPerlinNoiseMap::l_calc_2d_map(), LuaPerlinNoiseMap::l_calc_3d_map(), LuaVoxelManip::l_calc_lighting(), LuaItemStack::l_clear(), InvRef::l_contains_item(), ModApiEnv::l_dig_node(), LuaItemStack::l_equals(), LuaAreaStore::l_from_file(), LuaAreaStore::l_from_string(), ModApiMapgen::l_generate_decorations(), ModApiMapgen::l_generate_ores(), LuaSettings::l_get(), LuaPerlinNoise::l_get_2d(), LuaPerlinNoiseMap::l_get_2d_map(), LuaPerlinNoiseMap::l_get_2d_map_flat(), LuaPerlinNoise::l_get_3d(), LuaPerlinNoiseMap::l_get_3d_map(), LuaPerlinNoiseMap::l_get_3d_map_flat(), ObjectRef::l_get_acceleration(), LuaMinimap::l_get_angle(), ObjectRef::l_get_animation(), LuaAreaStore::l_get_area(), LuaAreaStore::l_get_areas_for_pos(), LuaAreaStore::l_get_areas_in_area(), ObjectRef::l_get_armor_groups(), ObjectRef::l_get_attach(), ObjectRef::l_get_attribute(), ObjectRef::l_get_bone_override(), ObjectRef::l_get_bone_overrides(), ObjectRef::l_get_bone_position(), LuaSettings::l_get_bool(), ObjectRef::l_get_breath(), ObjectRef::l_get_children(), ObjectRef::l_get_clouds(), LuaItemStack::l_get_count(), LuaVoxelManip::l_get_data(), ObjectRef::l_get_day_night_ratio(), LuaItemStack::l_get_definition(), LuaItemStack::l_get_description(), NodeTimerRef::l_get_elapsed(), LuaVoxelManip::l_get_emerged_area(), ObjectRef::l_get_entity_name(), ObjectRef::l_get_eye_offset(), LuaSettings::l_get_flags(), ObjectRef::l_get_flags(), ObjectRef::l_get_formspec_prepend(), ObjectRef::l_get_fov(), LuaItemStack::l_get_free_space(), ObjectRef::l_get_hp(), NodeMetaRef::l_get_inventory(), ObjectRef::l_get_inventory(), ObjectRef::l_get_inventory_formspec(), LuaVoxelManip::l_get_light_data(), ObjectRef::l_get_lighting(), InvRef::l_get_list(), InvRef::l_get_lists(), ObjectRef::l_get_local_animation(), InvRef::l_get_location(), ObjectRef::l_get_look_dir(), ObjectRef::l_get_look_horizontal(), ObjectRef::l_get_look_pitch(), ObjectRef::l_get_look_vertical(), ObjectRef::l_get_look_yaw(), ObjectRef::l_get_luaentity(), LuaPerlinNoiseMap::l_get_map_slice(), LuaItemStack::l_get_meta(), ObjectRef::l_get_meta(), LuaItemStack::l_get_metadata(), LuaMinimap::l_get_mode(), ObjectRef::l_get_moon(), LuaItemStack::l_get_name(), LuaSettings::l_get_names(), ObjectRef::l_get_nametag_attributes(), LuaVoxelManip::l_get_node_at(), LuaSettings::l_get_np_group(), LuaVoxelManip::l_get_param2_data(), ObjectRef::l_get_physics_override(), ObjectRef::l_get_player_control(), ObjectRef::l_get_player_control_bits(), ObjectRef::l_get_player_name(), LuaMinimap::l_get_pos(), ObjectRef::l_get_pos(), ObjectRef::l_get_properties(), ObjectRef::l_get_rotation(), LuaMinimap::l_get_shape(), LuaItemStack::l_get_short_description(), InvRef::l_get_size(), ObjectRef::l_get_sky(), ObjectRef::l_get_sky_color(), InvRef::l_get_stack(), LuaItemStack::l_get_stack_max(), ObjectRef::l_get_stars(), LuaPcgRandom::l_get_state(), LuaPseudoRandom::l_get_state(), ObjectRef::l_get_sun(), ObjectRef::l_get_texture_mod(), NodeTimerRef::l_get_timeout(), LuaItemStack::l_get_tool_capabilities(), ObjectRef::l_get_velocity(), LuaItemStack::l_get_wear(), LuaItemStack::l_get_wear_bar_params(), InvRef::l_get_width(), ObjectRef::l_get_wield_index(), ObjectRef::l_get_wield_list(), ObjectRef::l_get_wielded_item(), ObjectRef::l_get_yaw(), LuaSettings::l_has(), LuaMinimap::l_hide(), ObjectRef::l_hud_add(), ObjectRef::l_hud_change(), ObjectRef::l_hud_get(), ObjectRef::l_hud_get_all(), ObjectRef::l_hud_get_flags(), ObjectRef::l_hud_get_hotbar_image(), ObjectRef::l_hud_get_hotbar_itemcount(), ObjectRef::l_hud_get_hotbar_selected_image(), ObjectRef::l_hud_remove(), ObjectRef::l_hud_set_flags(), ObjectRef::l_hud_set_hotbar_image(), ObjectRef::l_hud_set_hotbar_itemcount(), ObjectRef::l_hud_set_hotbar_selected_image(), LuaAreaStore::l_insert_area(), InvRef::l_is_empty(), LuaItemStack::l_is_empty(), LuaItemStack::l_is_known(), ObjectRef::l_is_player(), NodeTimerRef::l_is_started(), ObjectRef::l_is_valid(), ModChannelRef::l_is_writeable(), LuaItemStack::l_item_fits(), ModChannelRef::l_leave(), NodeMetaRef::l_mark_as_private(), ObjectRef::l_move_to(), LuaPcgRandom::l_next(), LuaPseudoRandom::l_next(), LuaRaycast::l_next(), LuaSecureRandom::l_next_bytes(), ObjectRef::l_override_day_night_ratio(), LuaItemStack::l_peek_item(), ModApiEnv::l_place_node(), ModApiMapgen::l_place_schematic_on_vmanip(), ObjectRef::l_punch(), ModApiEnv::l_punch_node(), LuaPcgRandom::l_rand_normal_dist(), LuaVoxelManip::l_read_from_map(), LuaSettings::l_remove(), ObjectRef::l_remove(), LuaAreaStore::l_remove_area(), InvRef::l_remove_item(), LuaItemStack::l_replace(), LuaAreaStore::l_reserve(), ObjectRef::l_respawn(), ObjectRef::l_right_click(), InvRef::l_room_for_item(), ModChannelRef::l_send_all(), ObjectRef::l_send_mapblock(), LuaSettings::l_set(), NodeTimerRef::l_set(), ObjectRef::l_set_acceleration(), LuaMinimap::l_set_angle(), ObjectRef::l_set_animation(), ObjectRef::l_set_animation_frame_speed(), ObjectRef::l_set_armor_groups(), ObjectRef::l_set_attach(), ObjectRef::l_set_attribute(), ObjectRef::l_set_bone_override(), ObjectRef::l_set_bone_position(), LuaSettings::l_set_bool(), ObjectRef::l_set_breath(), LuaAreaStore::l_set_cache_params(), ObjectRef::l_set_clouds(), LuaItemStack::l_set_count(), LuaVoxelManip::l_set_data(), ObjectRef::l_set_detach(), ObjectRef::l_set_eye_offset(), ObjectRef::l_set_flags(), ObjectRef::l_set_formspec_prepend(), ObjectRef::l_set_fov(), ObjectRef::l_set_hp(), ObjectRef::l_set_inventory_formspec(), LuaVoxelManip::l_set_light_data(), LuaVoxelManip::l_set_lighting(), ObjectRef::l_set_lighting(), InvRef::l_set_list(), InvRef::l_set_lists(), ObjectRef::l_set_local_animation(), ObjectRef::l_set_look_horizontal(), ObjectRef::l_set_look_pitch(), ObjectRef::l_set_look_vertical(), ObjectRef::l_set_look_yaw(), LuaItemStack::l_set_metadata(), ObjectRef::l_set_minimap_modes(), LuaMinimap::l_set_mode(), ObjectRef::l_set_moon(), LuaItemStack::l_set_name(), ObjectRef::l_set_nametag_attributes(), LuaVoxelManip::l_set_node_at(), LuaSettings::l_set_np_group(), ObjectRef::l_set_observers(), LuaVoxelManip::l_set_param2_data(), ObjectRef::l_set_physics_override(), LuaMinimap::l_set_pos(), ObjectRef::l_set_pos(), ObjectRef::l_set_properties(), ObjectRef::l_set_rotation(), LuaMinimap::l_set_shape(), InvRef::l_set_size(), ObjectRef::l_set_sky(), ObjectRef::l_set_sprite(), InvRef::l_set_stack(), ObjectRef::l_set_stars(), LuaPcgRandom::l_set_state(), ObjectRef::l_set_sun(), ObjectRef::l_set_texture_mod(), ItemStackMetaRef::l_set_tool_capabilities(), ObjectRef::l_set_velocity(), LuaItemStack::l_set_wear(), ItemStackMetaRef::l_set_wear_bar_params(), InvRef::l_set_width(), ObjectRef::l_set_wielded_item(), ObjectRef::l_set_yaw(), LuaMinimap::l_show(), NodeTimerRef::l_start(), NodeTimerRef::l_stop(), LuaItemStack::l_take_item(), LuaAreaStore::l_to_file(), LuaAreaStore::l_to_string(), LuaItemStack::l_to_string(), LuaItemStack::l_to_table(), LuaSettings::l_to_table(), LuaVoxelManip::l_update_liquids(), LuaVoxelManip::l_was_modified(), LuaSettings::l_write(), LuaVoxelManip::l_write_to_map(), LuaItemStack::mt_tostring(), LuaItemStack::packIn(), LuaPerlinNoise::packIn(), LuaPerlinNoiseMap::packIn(), LuaVoxelManip::packIn(), read_item(), read_server_sound_params(), LuaParticleParams::readAttachmentID(), and ObjectRef::set_null().

◆ getCurrentModPath()

std::string ModApiBase::getCurrentModPath ( lua_State * L)
static

References ScriptApiBase::getCurrentModNameInsecure(), Server::getModSpec(), getServer(), and ModSpec::path.

Referenced by load_schematic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEmergeThread()

EmergeThread * ModApiBase::getEmergeThread ( lua_State * L)
static

References ScriptApiBase::getEmergeThread(), and getScriptApiBase().

Referenced by ModApiMapgen::getBiomeGen(), ModApiMapgen::getEmergeManager(), ModApiMapgen::getMapgen(), ModApiEnvVM::getVManip(), LuaVoxelManip::l_read_from_map(), ModApiMapgen::l_save_gen_notify(), LuaVoxelManip::l_write_to_map(), and ModApiMapgen::update_liquids().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEnv()

Environment * ModApiBase::getEnv ( lua_State * L)
static

References ScriptApiBase::getEnv(), and getScriptApiBase().

Referenced by ModApiAuth::getAuthDb(), ModApiServer::l_ban_player(), ModApiMapgen::l_create_schematic(), ModApiServer::l_disconnect_player(), ModApiServer::l_dynamic_add_media(), ModApiEnv::l_get_connected_players(), ModApiClient::l_get_meta(), ObjectRef::l_get_meta(), ModApiServer::l_remove_player(), and LuaVoxelManip::packOut().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGameDef()

IGameDef * ModApiBase::getGameDef ( lua_State * L)
static

References ScriptApiBase::getGameDef(), and getScriptApiBase().

Referenced by ModApiMapgen::calc_lighting(), ScriptApiSecurity::checkPathWithGamedef(), LuaItemStack::create_object(), ModChannelRef::getobject(), NodeMetaRef::handleFromTable(), ModApiIPC::Initialize(), LuaItemStack::l_add_item(), ModApiEnvVM::l_add_node_level(), LuaItemStack::l_add_wear(), LuaItemStack::l_add_wear_by_uses(), ModApiEnvVM::l_find_node_near(), ModApiEnvVM::l_find_nodes_in_area(), ModApiEnvVM::l_find_nodes_in_area_under_air(), ModApiCraft::l_get_all_craft_recipes(), ModApiItem::l_get_content_id(), ModApiCraft::l_get_craft_recipe(), ModApiCraft::l_get_craft_result(), LuaItemStack::l_get_description(), LuaItemStack::l_get_free_space(), ModApiServer::l_get_game_info(), ModApiClient::l_get_item_def(), ModApiStorage::l_get_mod_storage(), ModApiServer::l_get_modnames(), ModApiServer::l_get_modpath(), ModApiItem::l_get_name_from_content_id(), ModApiClient::l_get_node_def(), ModApiEnvVM::l_get_node_level(), ModApiEnvVM::l_get_node_max_level(), LuaItemStack::l_get_short_description(), LuaItemStack::l_get_stack_max(), LuaItemStack::l_get_tool_capabilities(), LuaItemStack::l_get_wear_bar_params(), ModApiIPC::l_ipc_cas(), ModApiIPC::l_ipc_get(), ModApiIPC::l_ipc_poll(), ModApiIPC::l_ipc_set(), LuaItemStack::l_is_known(), LuaItemStack::l_item_fits(), ModChannelRef::l_leave(), ModApiChannels::l_mod_channel_join(), ModApiMapgen::l_read_schematic(), LuaItemStack::l_replace(), ModChannelRef::l_send_all(), ModApiEnvVM::l_set_node_level(), ModApiEnvVM::l_spawn_tree(), and ModApiMapgen::update_liquids().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScriptApi()

template<typename T >
static T * ModApiBase::getScriptApi ( lua_State * L)
inlinestatic

References getScriptApiBase().

Referenced by ScriptApiSecurity::checkPath(), ModApiEnv::l_dig_node(), ModApiMainMenu::l_do_async_callback(), ModApiServer::l_do_async_callback(), ModApiEnv::l_place_node(), and ModApiEnv::l_punch_node().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScriptApiBase()

◆ getServer()

Server * ModApiBase::getServer ( lua_State * L)
static

References getScriptApiBase(), and ScriptApiBase::getServer().

Referenced by EmergeScripting::EmergeScripting(), ModApiMapgen::getBiomeGen(), getCurrentModPath(), ModApiMapgen::getEmergeManager(), ModApiMapgen::getMapgen(), ServerScripting::InitializeAsync(), InvRef::l_add_item(), ModApiEnv::l_add_item(), ModApiParticles::l_add_particle(), ModApiParticles::l_add_particlespawner(), ObjectRef::l_add_velocity(), ModApiServer::l_ban_player(), ModApiServer::l_chat_send_all(), ModApiServer::l_chat_send_player(), ModApiCraft::l_clear_craft(), ModApiMapgen::l_clear_registered_biomes(), ModApiMapgen::l_clear_registered_decorations(), ModApiMapgen::l_clear_registered_ores(), ModApiMapgen::l_clear_registered_schematics(), InvRef::l_contains_item(), ModApiInventory::l_create_detached_inventory_raw(), ModApiMapgen::l_create_schematic(), ModApiParticles::l_delete_particlespawner(), ModApiServer::l_disconnect_player(), ModApiServer::l_dynamic_add_media(), ModApiEnv::l_emerge_area(), ModApiServer::l_get_ban_description(), ModApiServer::l_get_ban_list(), ObjectRef::l_get_meta(), ModApiServer::l_get_mod_data_path(), ModApiServer::l_get_player_information(), ModApiServer::l_get_player_ip(), ModApiServer::l_get_player_privs(), ModApiServer::l_get_player_window_information(), ModApiServer::l_get_server_status(), ModApiServer::l_get_server_uptime(), ModApiMapgen::l_get_spawn_level(), ModApiEnv::l_get_translated_string(), ModApiServer::l_get_worldpath(), ObjectRef::l_hud_add(), ObjectRef::l_hud_change(), ObjectRef::l_hud_remove(), ObjectRef::l_hud_set_flags(), ObjectRef::l_hud_set_hotbar_image(), ObjectRef::l_hud_set_hotbar_itemcount(), ObjectRef::l_hud_set_hotbar_selected_image(), ModApiServer::l_is_singleplayer(), ModApiServer::l_notify_authentication_modified(), ObjectRef::l_override_day_night_ratio(), ModApiEnv::l_place_node(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ModApiServer::l_print(), ModApiItem::l_register_alias_raw(), ModApiServer::l_register_async_dofile(), ModApiMapgen::l_register_biome(), ModApiCraft::l_register_craft(), ModApiMapgen::l_register_decoration(), ModApiItem::l_register_item_raw(), ModApiServer::l_register_mapgen_script(), ModApiMapgen::l_register_ore(), ModApiMapgen::l_register_schematic(), InvRef::l_remove_item(), ModApiServer::l_request_shutdown(), ModApiRollback::l_rollback_get_node_actions(), ModApiRollback::l_rollback_revert_actions_by(), InvRef::l_room_for_item(), ObjectRef::l_send_mapblock(), ObjectRef::l_set_clouds(), ObjectRef::l_set_eye_offset(), ObjectRef::l_set_formspec_prepend(), ObjectRef::l_set_fov(), ModApiMapgen::l_set_gen_notify(), ObjectRef::l_set_inventory_formspec(), ObjectRef::l_set_lighting(), InvRef::l_set_list(), InvRef::l_set_lists(), ObjectRef::l_set_local_animation(), ModApiMapgen::l_set_mapgen_params(), ModApiMapgen::l_set_mapgen_setting(), ModApiMapgen::l_set_mapgen_setting_noiseparams(), ObjectRef::l_set_minimap_modes(), ObjectRef::l_set_moon(), ObjectRef::l_set_properties(), ObjectRef::l_set_sky(), InvRef::l_set_stack(), ObjectRef::l_set_stars(), ObjectRef::l_set_sun(), ModApiEnv::l_set_timeofday(), ObjectRef::l_set_wielded_item(), ModApiServer::l_show_formspec(), ModApiServer::l_sound_fade(), ModApiServer::l_sound_play(), ModApiServer::l_sound_stop(), ModApiServer::l_unban_player_or_ip(), and ModApiItem::l_unregister_item_raw().

+ Here is the call graph for this function:

◆ getServerInventoryMgr()

ServerInventoryManager * ModApiBase::getServerInventoryMgr ( lua_State * L)
static

References Server::getInventoryMgr(), getScriptApiBase(), and ScriptApiBase::getServer().

Referenced by InvRef::getinv(), ModApiInventory::l_create_detached_inventory_raw(), ModApiInventory::l_get_inventory(), ObjectRef::l_get_inventory(), ModApiInventory::l_remove_detached_inventory_raw(), and InvRef::reportInventoryChange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l_deprecated_function()

int ModApiBase::l_deprecated_function ( lua_State * L,
const char * good,
const char * bad,
lua_CFunction func )
static

A wrapper for deprecated functions.

When called, handles the deprecation according to user settings and then calls func.

Exceptions
LuaError if required by the user settings.
Parameters
LLua state
goodName of good function/method
badName of deprecated function/method
funcActual implementation of function
Returns
value from func

References Profiler::avg(), Error, FATAL_ERROR_IF, g_profiler, get_deprecated_handling_mode(), porting::getTimeUs(), hash(), Ignore, murmur_hash_64_ua(), and warningstream.

+ Here is the call graph for this function:

◆ registerClass()

void ModApiBase::registerClass ( lua_State * L,
const char * name,
const luaL_Reg * methods,
const luaL_Reg * metamethods )
static

◆ registerFunction()

bool ModApiBase::registerFunction ( lua_State * L,
const char * name,
lua_CFunction func,
int top )
static

Referenced by ModApiAuth::Initialize().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: