#include <vector>
#include <unordered_map>
#include "irrlichttypes_bloated.h"
#include "common/c_types.h"
#include <lua.h>
Go to the source code of this file.
Functions | |
std::string | getstringfield_default (lua_State *L, int table, const char *fieldname, const std::string &default_) |
bool | getboolfield_default (lua_State *L, int table, const char *fieldname, bool default_) |
float | getfloatfield_default (lua_State *L, int table, const char *fieldname, float default_) |
int | getintfield_default (lua_State *L, int table, const char *fieldname, int default_) |
bool | check_field_or_nil (lua_State *L, int index, int type, const char *fieldname) |
template<typename T > | |
bool | getintfield (lua_State *L, int table, const char *fieldname, T &result) |
template<class T > | |
bool | getv3intfield (lua_State *L, int index, const char *fieldname, T &result) |
v3s16 | getv3s16field_default (lua_State *L, int table, const char *fieldname, v3s16 default_) |
bool | getstringfield (lua_State *L, int table, const char *fieldname, std::string &result) |
size_t | getstringlistfield (lua_State *L, int table, const char *fieldname, std::vector< std::string > *result) |
void | read_groups (lua_State *L, int index, std::unordered_map< std::string, int > &result) |
bool | getboolfield (lua_State *L, int table, const char *fieldname, bool &result) |
bool | getfloatfield (lua_State *L, int table, const char *fieldname, float &result) |
void | setstringfield (lua_State *L, int table, const char *fieldname, const std::string &value) |
void | setintfield (lua_State *L, int table, const char *fieldname, int value) |
void | setfloatfield (lua_State *L, int table, const char *fieldname, float value) |
void | setboolfield (lua_State *L, int table, const char *fieldname, bool value) |
v3f | checkFloatPos (lua_State *L, int index) |
v3f | check_v3f (lua_State *L, int index) |
v3s16 | check_v3s16 (lua_State *L, int index) |
v3f | read_v3f (lua_State *L, int index) |
v2f | read_v2f (lua_State *L, int index) |
v2s16 | read_v2s16 (lua_State *L, int index) |
v2s32 | read_v2s32 (lua_State *L, int index) |
video::SColor | read_ARGB8 (lua_State *L, int index) |
bool | read_color (lua_State *L, int index, video::SColor *color) |
bool | is_color_table (lua_State *L, int index) |
aabb3f | read_aabb3f (lua_State *L, int index, f32 scale) |
v3s16 | read_v3s16 (lua_State *L, int index) |
std::vector< aabb3f > | read_aabb3f_vector (lua_State *L, int index, f32 scale) |
size_t | read_stringlist (lua_State *L, int index, std::vector< std::string > *result) |
void | push_float_string (lua_State *L, float value) |
void | push_v3_float_string (lua_State *L, v3f p) |
void | push_v2_float_string (lua_State *L, v2f p) |
void | push_v2s16 (lua_State *L, v2s16 p) |
void | push_v2s32 (lua_State *L, v2s32 p) |
void | push_v3s16 (lua_State *L, v3s16 p) |
void | push_aabb3f (lua_State *L, aabb3f box) |
void | push_ARGB8 (lua_State *L, video::SColor color) |
void | pushFloatPos (lua_State *L, v3f p) |
void | push_v3f (lua_State *L, v3f p) |
void | push_v2f (lua_State *L, v2f p) |
void | warn_if_field_exists (lua_State *L, int table, const char *fieldname, const std::string &message) |
size_t | write_array_slice_float (lua_State *L, int table_index, float *data, v3u16 data_size, v3u16 slice_offset, v3u16 slice_size) |
bool check_field_or_nil | ( | lua_State * | L, |
int | index, | ||
int | type, | ||
const char * | fieldname | ||
) |
References errorstream, hash(), murmur_hash_64_ua(), and script_get_backtrace().
Referenced by getboolfield(), getfloatfield(), getintfield(), getstringfield(), and read_content_features().
v3f check_v3f | ( | lua_State * | L, |
int | index | ||
) |
References CHECK_FLOAT_RANGE, CHECK_POS_COORD, and CHECK_POS_TAB.
Referenced by checkFloatPos(), ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), LuaPerlinNoiseMap::l_calc_3d_map(), LuaPerlinNoise::l_get_3d(), LuaPerlinNoiseMap::l_get_3d_map(), LuaPerlinNoiseMap::l_get_3d_map_flat(), ObjectRef::l_set_rotation(), and read_item_definition().
v3s16 check_v3s16 | ( | lua_State * | L, |
int | index | ||
) |
References check_v3d(), and doubleToInt().
Referenced by LuaVoxelManip::create_object(), LuaVoxelManip::l_calc_lighting(), ModApiMapgen::l_create_schematic(), ModApiEnvMod::l_find_nodes_with_meta(), ModApiMapgen::l_generate_decorations(), ModApiMapgen::l_generate_ores(), LuaAreaStore::l_get_areas_for_pos(), LuaAreaStore::l_get_areas_in_area(), ModApiInventory::l_get_inventory(), LuaVoxelManip::l_get_node_at(), LuaAreaStore::l_insert_area(), ModApiEnvMod::l_load_area(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), LuaVoxelManip::l_read_from_map(), LuaVoxelManip::l_set_lighting(), LuaVoxelManip::l_set_node_at(), and read_schematic_def().
v3f checkFloatPos | ( | lua_State * | L, |
int | index | ||
) |
References BS, and check_v3f().
Referenced by LuaRaycast::create_object(), ModApiEnvMod::l_add_entity(), ObjectRef::l_add_velocity(), ModApiEnvMod::l_get_objects_inside_radius(), ModApiEnvMod::l_line_of_sight(), ObjectRef::l_move_to(), ObjectRef::l_set_acceleration(), ObjectRef::l_set_pos(), and ObjectRef::l_set_velocity().
bool getboolfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
bool & | result | ||
) |
References check_field_or_nil(), and table.
Referenced by getboolfield_default(), ScriptApiEnv::initializeEnvironment(), ObjectRef::l_hud_set_flags(), ObjectRef::l_set_physics_override(), ModApiClient::l_sound_play(), ModApiEnvMod::l_spawn_tree(), read_content_features(), read_flags_table(), read_item_definition(), read_object_properties(), and read_server_sound_params().
bool getboolfield_default | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
bool | default_ | ||
) |
References getboolfield(), and table.
Referenced by ScriptApiEnv::initializeEnvironment(), ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiMapgen::l_serialize_schematic(), LuaAreaStore::l_set_cache_params(), ObjectRef::l_set_moon(), ObjectRef::l_set_sky(), ObjectRef::l_set_stars(), ObjectRef::l_set_sun(), ModApiHttp::read_http_fetch_request(), read_schematic_def(), and read_tiledef().
bool getfloatfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
float & | result | ||
) |
References check_field_or_nil(), and table.
Referenced by getfloatfield_default(), ScriptApiEnv::initializeEnvironment(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_physics_override(), ModApiClient::l_sound_play(), read_content_features(), read_noiseparams(), read_object_properties(), read_server_sound_params(), read_soundspec(), and read_tool_capabilities().
float getfloatfield_default | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
float | default_ | ||
) |
References getfloatfield(), and table.
Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiCraft::l_register_craft(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_clouds(), ObjectRef::l_set_moon(), ObjectRef::l_set_stars(), ObjectRef::l_set_sun(), read_biome_def(), read_item_definition(), and read_server_sound_params().
bool getintfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
T & | result | ||
) |
References check_field_or_nil(), and table.
Referenced by ScriptApiServer::getAuth(), getintfield_default(), getv3intfield(), ScriptApiEnv::initializeEnvironment(), ModApiAuth::l_auth_create(), ModApiAuth::l_auth_save(), ModApiMapgen::l_register_ore(), ModApiEnvMod::l_spawn_tree(), read_biome_def(), read_noiseparams(), read_object_properties(), read_schematic_def(), and read_tool_capabilities().
int getintfield_default | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
int | default_ | ||
) |
References getintfield(), and table.
Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiMapgen::l_create_schematic(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), ModApiMapgen::l_serialize_schematic(), LuaAreaStore::l_set_cache_params(), LuaVoxelManip::l_set_lighting(), ObjectRef::l_set_minimap_modes(), ObjectRef::l_set_stars(), read_biome_def(), read_content_features(), read_deco_simple(), ModApiHttp::read_http_fetch_request(), read_hud_element(), read_item(), read_item_definition(), read_schematic_def(), and read_tiledef().
bool getstringfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
std::string & | result | ||
) |
References check_field_or_nil(), and table.
Referenced by ScriptApiServer::getAuth(), getstringfield_default(), ScriptApiEnv::initializeEnvironment(), ModApiAuth::l_auth_create(), ModApiAuth::l_auth_save(), ModApiEnvMod::l_spawn_tree(), read_content_features(), ModApiHttp::read_http_fetch_request(), read_item_definition(), read_object_properties(), read_schematic_def(), read_server_sound_params(), read_soundspec(), and read_tiledef().
std::string getstringfield_default | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
const std::string & | default_ | ||
) |
References getstringfield(), and table.
Referenced by getenumfield(), ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiCraft::l_clear_craft(), ModApiCraft::l_get_craft_result(), ModApiMapgen::l_read_schematic(), ModApiCraft::l_register_craft(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), ObjectRef::l_set_minimap_modes(), ObjectRef::l_set_moon(), ObjectRef::l_set_nametag_attributes(), ObjectRef::l_set_sun(), read_biome_def(), ModApiHttp::read_http_fetch_request(), read_hud_element(), read_item(), and ScriptApiBase::setOriginFromTableRaw().
size_t getstringlistfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
std::vector< std::string > * | result | ||
) |
References read_stringlist(), and table.
Referenced by ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), read_biome_def(), and read_deco_simple().
bool getv3intfield | ( | lua_State * | L, |
int | index, | ||
const char * | fieldname, | ||
T & | result | ||
) |
References getintfield().
Referenced by getv3s16field_default().
References getv3intfield(), and table.
Referenced by read_biome_def().
bool is_color_table | ( | lua_State * | L, |
int | index | ||
) |
void push_aabb3f | ( | lua_State * | L, |
aabb3f | box | ||
) |
Referenced by push_box(), push_nodebox(), and push_object_properties().
void push_ARGB8 | ( | lua_State * | L, |
video::SColor | color | ||
) |
Referenced by ObjectRef::l_get_clouds(), ObjectRef::l_get_nametag_attributes(), ObjectRef::l_get_sky(), ObjectRef::l_get_sky_color(), ObjectRef::l_get_stars(), push_content_features(), push_item_definition_full(), push_object_properties(), and push_palette().
void push_float_string | ( | lua_State * | L, |
float | value | ||
) |
Referenced by push_noiseparams(), push_v2_float_string(), and push_v3_float_string().
void push_v2_float_string | ( | lua_State * | L, |
v2f | p | ||
) |
void push_v2f | ( | lua_State * | L, |
v2f | p | ||
) |
References p().
Referenced by ObjectRef::l_get_animation(), and push_hud_element().
void push_v2s16 | ( | lua_State * | L, |
v2s16 | p | ||
) |
References p().
Referenced by push_object_properties().
void push_v2s32 | ( | lua_State * | L, |
v2s32 | p | ||
) |
References p().
Referenced by ObjectRef::l_get_local_animation(), and push_hud_element().
void push_v3_float_string | ( | lua_State * | L, |
v3f | p | ||
) |
References p(), and push_float_string().
Referenced by push_noiseparams().
void push_v3f | ( | lua_State * | L, |
v3f | p | ||
) |
References p().
Referenced by ObjectRef::l_get_attach(), ObjectRef::l_get_bone_position(), ObjectRef::l_get_eye_offset(), LuaLocalPlayer::l_get_last_pos(), LuaLocalPlayer::l_get_last_velocity(), LuaCamera::l_get_look_dir(), ObjectRef::l_get_look_dir(), LuaCamera::l_get_offset(), LuaCamera::l_get_pos(), LuaLocalPlayer::l_get_pos(), ObjectRef::l_get_pos(), ObjectRef::l_get_rotation(), LuaLocalPlayer::l_get_velocity(), ObjectRef::l_get_velocity(), ScriptApiEntity::luaentity_Punch(), ScriptApiPlayer::on_punchplayer(), push_collision_move_result(), push_hud_element(), push_item_definition_full(), push_object_properties(), push_pointed_thing(), and pushFloatPos().
void push_v3s16 | ( | lua_State * | L, |
v3s16 | p | ||
) |
References p().
Referenced by ScriptApiEnv::environment_OnGenerated(), ModApiEnvMod::l_find_node_near(), ModApiEnvMod::l_find_nodes_in_area(), ModApiEnvMod::l_find_nodes_in_area_under_air(), ModApiEnvMod::l_find_nodes_with_meta(), ModApiEnvMod::l_find_path(), LuaVoxelManip::l_get_emerged_area(), InvRef::l_get_location(), ModApiMapgen::l_get_mapgen_object(), LuaMinimap::l_get_pos(), ModApiEnvMod::l_line_of_sight(), LuaVoxelManip::l_read_from_map(), ModApiMapgen::l_read_schematic(), ModApiRollback::l_rollback_get_node_actions(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_construct(), ScriptApiNode::node_on_destruct(), ScriptApiNode::node_on_dig(), ScriptApiNode::node_on_flood(), ScriptApiNode::node_on_punch(), ScriptApiNode::node_on_receive_fields(), ScriptApiNode::node_on_timer(), ScriptApiNodemeta::nodemeta_inventory_AllowMove(), ScriptApiNodemeta::nodemeta_inventory_AllowPut(), ScriptApiNodemeta::nodemeta_inventory_AllowTake(), ScriptApiNodemeta::nodemeta_inventory_OnMove(), ScriptApiNodemeta::nodemeta_inventory_OnPut(), ScriptApiNodemeta::nodemeta_inventory_OnTake(), ScriptApiClient::on_dignode(), ScriptApiEnv::on_emerge_area_completion(), ScriptApiClient::on_punchnode(), push_area(), push_collision_move_result(), push_pointed_thing(), LuaLBM::trigger(), and LuaABM::trigger().
void pushFloatPos | ( | lua_State * | L, |
v3f | p | ||
) |
References BS, p(), and push_v3f().
Referenced by ScriptApiItem::item_OnDrop(), ObjectRef::l_get_acceleration(), and ObjectRef::l_get_velocity().
aabb3f read_aabb3f | ( | lua_State * | L, |
int | index, | ||
f32 | scale | ||
) |
Referenced by read_aabb3f_vector(), and read_object_properties().
std::vector<aabb3f> read_aabb3f_vector | ( | lua_State * | L, |
int | index, | ||
f32 | scale | ||
) |
video::SColor read_ARGB8 | ( | lua_State * | L, |
int | index | ||
) |
bool read_color | ( | lua_State * | L, |
int | index, | ||
video::SColor * | color | ||
) |
References parseColorString(), and read_ARGB8().
Referenced by ObjectRef::l_set_clouds(), ObjectRef::l_set_nametag_attributes(), ObjectRef::l_set_sky(), ObjectRef::l_set_stars(), read_content_features(), read_item_definition(), read_object_properties(), and read_tiledef().
void read_groups | ( | lua_State * | L, |
int | index, | ||
std::unordered_map< std::string, int > & | result | ||
) |
Referenced by ModApiUtil::l_get_dig_params(), ModApiUtil::l_get_hit_params(), ObjectRef::l_set_armor_groups(), read_content_features(), and read_item_definition().
size_t read_stringlist | ( | lua_State * | L, |
int | index, | ||
std::vector< std::string > * | result | ||
) |
v2f read_v2f | ( | lua_State * | L, |
int | index | ||
) |
References CHECK_POS_TAB, and p().
Referenced by read_hud_change(), read_hud_element(), and read_object_properties().
v2s16 read_v2s16 | ( | lua_State * | L, |
int | index | ||
) |
References CHECK_POS_TAB, and p().
Referenced by read_object_properties().
v2s32 read_v2s32 | ( | lua_State * | L, |
int | index | ||
) |
References CHECK_POS_TAB, and p().
Referenced by ObjectRef::l_set_local_animation(), read_hud_change(), and read_hud_element().
v3f read_v3f | ( | lua_State * | L, |
int | index | ||
) |
References CHECK_POS_TAB.
Referenced by ModApiEnvMod::l_get_objects_in_area(), ModApiClient::l_sound_play(), read_hud_change(), read_hud_element(), read_noiseparams(), and read_server_sound_params().
v3s16 read_v3s16 | ( | lua_State * | L, |
int | index | ||
) |
References doubleToInt(), and read_v3d().
Referenced by LuaPerlinNoiseMap::create_object(), ModApiEnvMod::l_add_node_level(), ModApiEnvMod::l_bulk_set_node(), ModApiEnvMod::l_delete_area(), ModApiEnvMod::l_dig_node(), ModApiEnvMod::l_emerge_area(), ModApiEnvMod::l_find_node_near(), ModApiEnvMod::l_find_nodes_in_area(), ModApiEnvMod::l_find_nodes_in_area_under_air(), ModApiEnvMod::l_find_path(), ModApiEnvMod::l_fix_light(), ModApiEnvMod::l_forceload_block(), ModApiEnvMod::l_forceload_free_block(), ModApiMapgen::l_get_biome_data(), ModApiMapgen::l_get_heat(), ModApiMapgen::l_get_humidity(), LuaPerlinNoiseMap::l_get_map_slice(), ModApiClient::l_get_meta(), ModApiEnvMod::l_get_meta(), ModApiEnvMod::l_get_natural_light(), ModApiEnvMod::l_get_node(), ModApiEnvMod::l_get_node_level(), ModApiEnvMod::l_get_node_light(), ModApiEnvMod::l_get_node_max_level(), ModApiClient::l_get_node_or_nil(), ModApiEnvMod::l_get_node_or_nil(), ModApiEnvMod::l_get_node_timer(), ModApiEnvMod::l_get_perlin_map(), ModApiEnvMod::l_get_voxel_manip(), ModApiEnvMod::l_place_node(), ModApiEnvMod::l_punch_node(), ModApiEnvMod::l_remove_node(), ModApiRollback::l_rollback_get_node_actions(), ObjectRef::l_send_mapblock(), ModApiEnvMod::l_set_node(), ModApiEnvMod::l_set_node_level(), LuaMinimap::l_set_pos(), ModApiEnvMod::l_spawn_tree(), ModApiEnvMod::l_swap_node(), and ModApiEnvMod::l_transforming_liquid_add().
void setboolfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
bool | value | ||
) |
References table.
Referenced by ModApiClient::l_get_csm_restrictions(), push_collision_move_result(), push_dig_params(), ModApiHttp::push_http_fetch_result(), and ScriptApiMainMenu::setMainMenuData().
void setfloatfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
float | value | ||
) |
References table.
Referenced by push_dig_params(), and push_tool_capabilities().
void setintfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
int | value | ||
) |
References table.
Referenced by ModApiCraft::l_get_craft_recipe(), ModApiCraft::l_get_craft_result(), push_craft_recipe(), push_dig_params(), push_hit_params(), ModApiHttp::push_http_fetch_result(), and push_tool_capabilities().
void setstringfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
const std::string & | value | ||
) |
References table.
Referenced by ModApiHttp::push_http_fetch_result().
void warn_if_field_exists | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
const std::string & | message | ||
) |
References infostream, script_get_backtrace(), table, and warningstream.
Referenced by ModApiMapgen::l_register_ore(), and read_content_features().
size_t write_array_slice_float | ( | lua_State * | L, |
int | table_index, | ||
float * | data, | ||
v3u16 | data_size, | ||
v3u16 | slice_offset, | ||
v3u16 | slice_size | ||
) |
References MYMIN.
Referenced by LuaPerlinNoiseMap::l_get_map_slice().