#include "common/c_content.h"
#include "common/c_converter.h"
#include "common/c_types.h"
#include "nodedef.h"
#include "object_properties.h"
#include "collision.h"
#include "cpp_api/s_node.h"
#include "lua_api/l_object.h"
#include "lua_api/l_item.h"
#include "common/c_internal.h"
#include "server.h"
#include "log.h"
#include "tool.h"
#include "porting.h"
#include "mapgen/mg_schematic.h"
#include "noise.h"
#include "server/player_sao.h"
#include "util/pointedthing.h"
#include "debug.h"
#include <SColor.h>
#include <json/json.h>
#include "mapgen/treegen.h"
Macros | |
#define | NODEBOXREAD(n, s) |
#define | NODEBOXREADVEC(n, s) |
Functions | |
void | read_item_definition (lua_State *L, int index, const ItemDefinition &default_def, ItemDefinition &def) |
void | push_item_definition (lua_State *L, const ItemDefinition &i) |
void | push_item_definition_full (lua_State *L, const ItemDefinition &i) |
void | read_object_properties (lua_State *L, int index, ServerActiveObject *sao, ObjectProperties *prop, IItemDefManager *idef) |
void | push_object_properties (lua_State *L, const ObjectProperties *prop) |
TileDef | read_tiledef (lua_State *L, int index, u8 drawtype, bool special) |
void | read_content_features (lua_State *L, ContentFeatures &f, int index) |
void | push_content_features (lua_State *L, const ContentFeatures &c) |
void | push_nodebox (lua_State *L, const NodeBox &box) |
void | push_palette (lua_State *L, const std::vector< video::SColor > *palette) |
void | read_server_sound_params (lua_State *L, int index, ServerPlayingSound ¶ms) |
void | read_simplesoundspec (lua_State *L, int index, SoundSpec &spec) |
void | push_simplesoundspec (lua_State *L, const SoundSpec &spec) |
NodeBox | read_nodebox (lua_State *L, int index) |
MapNode | readnode (lua_State *L, int index) |
void | pushnode (lua_State *L, const MapNode &n) |
void | warn_if_field_exists (lua_State *L, int table, const char *fieldname, std::string_view name, std::string_view message) |
int | getenumfield (lua_State *L, int table, const char *fieldname, const EnumString *spec, int default_) |
bool | string_to_enum (const EnumString *spec, int &result, const std::string &str) |
ItemStack | read_item (lua_State *L, int index, IItemDefManager *idef) |
void | push_tool_capabilities (lua_State *L, const ToolCapabilities &toolcap) |
void | push_wear_bar_params (lua_State *L, const WearBarParams ¶ms) |
void | push_inventory_list (lua_State *L, const InventoryList &invlist) |
void | push_inventory_lists (lua_State *L, const Inventory &inv) |
void | read_inventory_list (lua_State *L, int tableindex, Inventory *inv, const char *name, IGameDef *gdef, int forcesize) |
struct TileAnimationParams | read_animation_definition (lua_State *L, int index) |
ToolCapabilities | read_tool_capabilities (lua_State *L, int table) |
PointabilityType | read_pointability_type (lua_State *L, int index) |
Pointabilities | read_pointabilities (lua_State *L, int index) |
void | push_pointability_type (lua_State *L, PointabilityType pointable) |
void | push_pointabilities (lua_State *L, const Pointabilities &pointabilities) |
WearBarParams | read_wear_bar_params (lua_State *L, int stack_idx) |
void | push_dig_params (lua_State *L, const DigParams ¶ms) |
void | push_hit_params (lua_State *L, const HitParams ¶ms) |
bool | getflagsfield (lua_State *L, int table, const char *fieldname, FlagDesc *flagdesc, u32 *flags, u32 *flagmask) |
bool | read_flags (lua_State *L, int index, FlagDesc *flagdesc, u32 *flags, u32 *flagmask) |
u32 | read_flags_table (lua_State *L, int table, FlagDesc *flagdesc, u32 *flagmask) |
void | push_flags_string (lua_State *L, FlagDesc *flagdesc, u32 flags, u32 flagmask) |
void | read_groups (lua_State *L, int index, ItemGroupList &result) |
void | push_groups (lua_State *L, const ItemGroupList &groups) |
void | push_items (lua_State *L, const std::vector< ItemStack > &items) |
std::vector< ItemStack > | read_items (lua_State *L, int index, IGameDef *gdef) |
void | luaentity_get (lua_State *L, u16 id) |
bool | read_noiseparams (lua_State *L, int index, NoiseParams *np) |
void | push_noiseparams (lua_State *L, NoiseParams *np) |
bool | read_tree_def (lua_State *L, int idx, const NodeDefManager *ndef, treegen::TreeDef &tree_def) |
static int | push_json_value_getdepth (const Json::Value &value) |
static bool | push_json_value_helper (lua_State *L, const Json::Value &value, int nullindex) |
bool | push_json_value (lua_State *L, const Json::Value &value, int nullindex) |
void | read_json_value (lua_State *L, Json::Value &root, int index, u16 max_depth) |
void | push_pointed_thing (lua_State *L, const PointedThing &pointed, bool csm, bool hitpoint) |
void | push_objectRef (lua_State *L, const u16 id) |
void | read_hud_element (lua_State *L, HudElement *elem) |
void | push_hud_element (lua_State *L, HudElement *elem) |
bool | read_hud_change (lua_State *L, HudElementStat &stat, HudElement *elem, void **value) |
void | push_collision_move_result (lua_State *L, const collisionMoveResult &res) |
void | push_mod_spec (lua_State *L, const ModSpec &spec, bool include_unsatisfied) |
Variables | |
struct EnumString | es_TileAnimationType [] |
const std::array< const char *, 33 > | object_property_keys |
static const char * | collision_type_str [] |
static const char * | collision_axis_str [] |
#define NODEBOXREAD | ( | n, | |
s ) |
Referenced by read_nodebox().
#define NODEBOXREADVEC | ( | n, | |
s ) |
Referenced by read_nodebox().
int getenumfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
const EnumString * | spec, | ||
int | default_ ) |
References getstringfield_default(), string_to_enum(), and table.
Referenced by ModApiEnv::l_clear_objects(), ModApiCraft::l_get_craft_result(), ModApiMapgen::l_register_decoration(), read_animation_definition(), read_biome_def(), read_content_features(), read_deco_schematic(), read_item_definition(), and read_nodebox().
bool getflagsfield | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
FlagDesc * | flagdesc, | ||
u32 * | flags, | ||
u32 * | flagmask ) |
References read_flags(), and table.
Referenced by ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), and read_noiseparams().
void luaentity_get | ( | lua_State * | L, |
u16 | id ) |
Referenced by ObjectRef::l_get_luaentity(), ScriptApiEntity::luaentity_Activate(), ScriptApiEntity::luaentity_Deactivate(), ScriptApiEntity::luaentity_GetProperties(), ScriptApiEntity::luaentity_GetStaticdata(), ScriptApiEntity::luaentity_Punch(), ScriptApiEntity::luaentity_run_simple_callback(), and ScriptApiEntity::luaentity_Step().
void push_collision_move_result | ( | lua_State * | L, |
const collisionMoveResult & | res ) |
References BS, collisionMoveResult::collides, COLLISION_AXIS_NONE, collision_axis_str, COLLISION_NODE, COLLISION_OBJECT, collision_type_str, collisionMoveResult::collisions, CUSTOM_RIDX_PUSH_MOVERESULT1, push_objectRef(), push_v3f(), push_v3s16(), setboolfield(), collisionMoveResult::standing_on_object, and collisionMoveResult::touching_ground.
Referenced by ScriptApiEntity::luaentity_Step().
void push_content_features | ( | lua_State * | L, |
const ContentFeatures & | c ) |
References ContentFeatures::alpha, ContentFeatures::buildable_to, ContentFeatures::climbable, ContentFeatures::collision_box, ContentFeatures::color, ContentFeatures::connect_sides, ContentFeatures::connects_to, ContentFeatures::damage_per_second, ContentFeatures::diggable, ContentFeatures::drawtype, ContentFeatures::drowning, ScriptApiNode::es_ContentParamType, ScriptApiNode::es_ContentParamType2, ScriptApiNode::es_DrawType, ScriptApiNode::es_LiquidType, ContentFeatures::floodable, ContentFeatures::groups, ContentFeatures::has_after_destruct, ContentFeatures::has_on_construct, ContentFeatures::has_on_destruct, ContentFeatures::is_ground_content, ContentFeatures::isLiquid(), ContentFeatures::legacy_facedir_simple, ContentFeatures::legacy_wallmounted, ContentFeatures::leveled, ContentFeatures::leveled_max, ContentFeatures::light_source, ContentFeatures::liquid_alternative_flowing, ContentFeatures::liquid_alternative_source, ContentFeatures::liquid_move_physics, ContentFeatures::liquid_range, ContentFeatures::liquid_renewable, ContentFeatures::liquid_type, ContentFeatures::liquid_viscosity, ContentFeatures::mesh, ContentFeatures::move_resistance, ContentFeatures::name, ContentFeatures::node_box, ContentFeatures::node_dig_prediction, ContentFeatures::palette, ContentFeatures::palette_name, ContentFeatures::param_type, ContentFeatures::param_type_2, ContentFeatures::pointable, ContentFeatures::post_effect_color, ContentFeatures::post_effect_color_shaded, push_ARGB8(), push_groups(), push_nodebox(), push_palette(), push_pointability_type(), push_simplesoundspec(), ContentFeatures::rightclickable, ContentFeatures::selection_box, ContentFeatures::sound_dig, ContentFeatures::sound_dug, ContentFeatures::sound_footstep, EnumString::str, ContentFeatures::sunlight_propagates, ContentFeatures::visual_scale, ContentFeatures::walkable, and ContentFeatures::waving.
Referenced by ModApiClient::l_get_node_def().
void push_dig_params | ( | lua_State * | L, |
const DigParams & | params ) |
References DigParams::diggable, setboolfield(), setfloatfield(), setintfield(), DigParams::time, and DigParams::wear.
Referenced by ModApiUtil::l_get_dig_params().
void push_flags_string | ( | lua_State * | L, |
FlagDesc * | flagdesc, | ||
u32 | flags, | ||
u32 | flagmask ) |
References writeFlagString().
Referenced by ModApiMapgen::l_get_gen_notify(), and push_noiseparams().
void push_groups | ( | lua_State * | L, |
const ItemGroupList & | groups ) |
Referenced by LuaLocalPlayer::l_get_armor_groups(), ObjectRef::l_get_armor_groups(), push_content_features(), and push_item_definition_full().
void push_hit_params | ( | lua_State * | L, |
const HitParams & | params ) |
References HitParams::hp, setintfield(), and HitParams::wear.
Referenced by ModApiUtil::l_get_hit_params().
void push_hud_element | ( | lua_State * | L, |
HudElement * | elem ) |
References HudElement::align, HudElement::dir, es_HudElementType, HUD_ELEM_WAYPOINT, HudElement::item, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, push_v2f(), push_v2s32(), push_v3f(), HudElement::scale, HudElement::size, EnumString::str, HudElement::style, HudElement::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.
Referenced by LuaLocalPlayer::l_hud_get(), ObjectRef::l_hud_get(), LuaLocalPlayer::l_hud_get_all(), and ObjectRef::l_hud_get_all().
void push_inventory_list | ( | lua_State * | L, |
const InventoryList & | invlist ) |
References InventoryList::getItems(), and push_items().
Referenced by InvRef::l_get_list(), and push_inventory_lists().
void push_inventory_lists | ( | lua_State * | L, |
const Inventory & | inv ) |
References Inventory::getLists(), and push_inventory_list().
Referenced by NodeMetaRef::handleToTable(), InvRef::l_get_lists(), and ScriptApiClient::on_inventory_open().
void push_item_definition | ( | lua_State * | L, |
const ItemDefinition & | i ) |
References ItemDefinition::description, and ItemDefinition::name.
Referenced by ScriptApiClient::on_placenode().
void push_item_definition_full | ( | lua_State * | L, |
const ItemDefinition & | i ) |
References ItemDefinition::color, ItemDefinition::description, es_ItemType, es_TouchInteractionMode, ItemDefinition::groups, ItemDefinition::inventory_image, ItemDefinition::inventory_overlay, ItemDefinition::liquids_pointable, ItemDefinition::name, ItemDefinition::node_placement_prediction, ItemDefinition::palette_image, ItemDefinition::pointabilities, TouchInteraction::pointed_node, TouchInteraction::pointed_nothing, TouchInteraction::pointed_object, push_ARGB8(), push_groups(), push_pointabilities(), push_simplesoundspec(), push_tool_capabilities(), push_v3f(), push_wear_bar_params(), ItemDefinition::short_description, ItemDefinition::sound_place, ItemDefinition::sound_place_failed, ItemDefinition::stack_max, EnumString::str, ItemDefinition::tool_capabilities, ItemDefinition::touch_interaction, ItemDefinition::type, ItemDefinition::usable, ItemDefinition::wallmounted_rotate_vertical, ItemDefinition::wear_bar_params, ItemDefinition::wield_image, ItemDefinition::wield_overlay, and ItemDefinition::wield_scale.
Referenced by ModApiClient::l_get_item_def().
void push_items | ( | lua_State * | L, |
const std::vector< ItemStack > & | items ) |
References LuaItemStack::create().
Referenced by ScriptApiItem::item_CraftPredict(), ScriptApiItem::item_OnCraft(), ModApiCraft::l_get_craft_result(), and push_inventory_list().
bool push_json_value | ( | lua_State * | L, |
const Json::Value & | value, | ||
int | nullindex ) |
References push_json_value_getdepth(), and push_json_value_helper().
Referenced by ModApiUtil::l_parse_json().
|
static |
References push_json_value_getdepth().
Referenced by push_json_value(), and push_json_value_getdepth().
|
static |
References push_json_value_helper().
Referenced by push_json_value(), and push_json_value_helper().
void push_mod_spec | ( | lua_State * | L, |
const ModSpec & | spec, | ||
bool | include_unsatisfied ) |
References ModSpec::author, ModSpec::desc, ModSpec::name, ModSpec::path, ModSpec::release, ModSpec::unsatisfied_depends, and ModSpec::virtual_path.
Referenced by ModApiMainMenu::l_check_mod_configuration().
void push_nodebox | ( | lua_State * | L, |
const NodeBox & | box ) |
References FATAL_ERROR, NodeBox::fixed, NodeBox::getConnected(), NODEBOX_CONNECTED, NODEBOX_FIXED, NODEBOX_LEVELED, NODEBOX_REGULAR, NODEBOX_WALLMOUNTED, push_aabb3f(), push_aabb3f_vector(), NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.
Referenced by push_content_features().
void push_noiseparams | ( | lua_State * | L, |
NoiseParams * | np ) |
References flagdesc_noiseparams, NoiseParams::flags, NoiseParams::lacunarity, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, push_flags_string(), push_v3f(), NoiseParams::scale, NoiseParams::seed, setfloatfield(), setintfield(), and NoiseParams::spread.
Referenced by ModApiMapgen::l_get_mapgen_setting_noiseparams(), ModApiMapgen::l_get_noiseparams(), and LuaSettings::l_get_np_group().
void push_object_properties | ( | lua_State * | L, |
const ObjectProperties * | prop ) |
References ObjectProperties::automatic_face_movement_dir, ObjectProperties::automatic_face_movement_dir_offset, ObjectProperties::automatic_face_movement_max_rotation_per_sec, ObjectProperties::automatic_rotate, ObjectProperties::backface_culling, ObjectProperties::breath_max, BS, ObjectProperties::collideWithObjects, ObjectProperties::collisionbox, ObjectProperties::colors, ObjectProperties::damage_texture_modifier, ObjectProperties::eye_height, ObjectProperties::glow, ObjectProperties::hp_max, ObjectProperties::infotext, ObjectProperties::initial_sprite_basepos, ObjectProperties::is_visible, ObjectProperties::makes_footstep_sound, ObjectProperties::mesh, ObjectProperties::nametag, ObjectProperties::nametag_bgcolor, ObjectProperties::nametag_color, ObjectProperties::physical, ObjectProperties::pointable, push_aabb3f(), push_ARGB8(), push_pointability_type(), push_v2s16(), push_v3f(), ObjectProperties::rotate_selectionbox, ObjectProperties::selectionbox, ObjectProperties::shaded, ObjectProperties::show_on_minimap, ObjectProperties::spritediv, ObjectProperties::static_save, ObjectProperties::stepheight, ObjectProperties::textures, ObjectProperties::use_texture_alpha, ObjectProperties::visual, ObjectProperties::visual_size, ObjectProperties::wield_item, and ObjectProperties::zoom_fov.
Referenced by ObjectRef::l_get_properties().
void push_objectRef | ( | lua_State * | L, |
const u16 | id ) |
Referenced by ScriptApiEntity::luaentity_Add(), ScriptApiBase::objectrefGetOrCreate(), push_collision_move_result(), and push_pointed_thing().
void push_palette | ( | lua_State * | L, |
const std::vector< video::SColor > * | palette ) |
References push_ARGB8().
Referenced by push_content_features().
void push_pointabilities | ( | lua_State * | L, |
const Pointabilities & | pointabilities ) |
References Pointabilities::node_groups, Pointabilities::nodes, Pointabilities::object_groups, Pointabilities::objects, and push_pointability_type().
Referenced by push_item_definition_full().
void push_pointability_type | ( | lua_State * | L, |
PointabilityType | pointable ) |
References POINTABLE, POINTABLE_BLOCKING, and POINTABLE_NOT.
Referenced by push_content_features(), push_object_properties(), and push_pointabilities().
void push_pointed_thing | ( | lua_State * | L, |
const PointedThing & | pointed, | ||
bool | csm = false, | ||
bool | hitpoint = false ) |
Pushes a Lua pointed_thing
to the given Lua stack.
csm | If true, a client side pointed thing is pushed |
hitpoint | If true, the exact pointing location is also pushed |
References PointedThing::box_id, BS, PointedThing::intersection_normal, PointedThing::intersection_point, PointedThing::node_abovesurface, PointedThing::node_undersurface, PointedThing::object_id, POINTEDTHING_NODE, POINTEDTHING_NOTHING, POINTEDTHING_OBJECT, push_objectRef(), push_v3f(), push_v3s16(), and PointedThing::type.
Referenced by LuaRaycast::l_next(), ScriptApiClient::on_item_use(), ScriptApiClient::on_placenode(), and ScriptApiItem::pushPointedThing().
void push_simplesoundspec | ( | lua_State * | L, |
const SoundSpec & | spec ) |
References SoundSpec::fade, SoundSpec::gain, SoundSpec::name, and SoundSpec::pitch.
Referenced by push_content_features(), and push_item_definition_full().
void push_tool_capabilities | ( | lua_State * | L, |
const ToolCapabilities & | toolcap ) |
References ToolCapabilities::damageGroups, ToolCapabilities::full_punch_interval, ToolCapabilities::groupcaps, ToolCapabilities::max_drop_level, ToolGroupCap::maxlevel, ToolCapabilities::punch_attack_uses, setfloatfield(), setintfield(), ToolGroupCap::times, and ToolGroupCap::uses.
Referenced by LuaItemStack::l_get_tool_capabilities(), ScriptApiEntity::luaentity_Punch(), ScriptApiPlayer::on_punchplayer(), and push_item_definition_full().
void push_wear_bar_params | ( | lua_State * | L, |
const WearBarParams & | params ) |
References WearBarParams::blend, WearBarParams::colorStops, WearBarParams::es_BlendMode, push_ARGB8(), setstringfield(), and EnumString::str.
Referenced by LuaItemStack::l_get_wear_bar_params(), and push_item_definition_full().
void pushnode | ( | lua_State * | L, |
const MapNode & | n ) |
References CUSTOM_RIDX_PUSH_NODE, MapNode::getContent(), MapNode::getParam1(), and MapNode::getParam2().
Referenced by LuaVoxelManip::l_get_node_at(), ModApiClient::l_get_node_or_nil(), ModApiEnvVM::l_get_node_or_nil(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_dig(), ScriptApiNode::node_on_flood(), ScriptApiNode::node_on_punch(), ScriptApiClient::on_dignode(), ScriptApiEnv::on_liquid_transformed(), ScriptApiClient::on_punchnode(), and ScriptApiEnv::triggerABM().
struct TileAnimationParams read_animation_definition | ( | lua_State * | L, |
int | index ) |
References TileAnimationParams::aspect_h, TileAnimationParams::aspect_w, es_TileAnimationType, TileAnimationParams::frame_length, TileAnimationParams::frames_h, TileAnimationParams::frames_w, getenumfield(), getfloatfield(), getfloatfield_default(), getintfield(), getintfield_default(), TileAnimationParams::length, TileAnimationParams::sheet_2d, TAT_NONE, TAT_SHEET_2D, TAT_VERTICAL_FRAMES, TileAnimationParams::type, and TileAnimationParams::vertical_frames.
Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), read_tiledef(), and LuaParticleParams::readTexValue().
void read_content_features | ( | lua_State * | L, |
ContentFeatures & | f, | ||
int | index ) |
References ContentFeatures::alpha, ALPHAMODE_BLEND, ALPHAMODE_CLIP, ContentFeatures::buildable_to, CF_SPECIAL_COUNT, check_field_or_nil(), ContentFeatures::climbable, ContentFeatures::collision_box, ContentFeatures::color, ContentFeatures::connect_sides, ContentFeatures::connects_to, CPT2_COLOR, CPT2_COLORED_4DIR, CPT2_COLORED_DEGROTATE, CPT2_COLORED_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_NONE, CPT_LIGHT, CPT_NONE, ContentFeatures::damage_per_second, ContentFeatures::diggable, ContentFeatures::drawtype, ContentFeatures::drowning, errorstream, ScriptApiNode::es_ContentParamType, ScriptApiNode::es_ContentParamType2, ScriptApiNode::es_DrawType, ScriptApiNode::es_LiquidType, ScriptApiNode::es_TextureAlphaMode, ContentFeatures::floodable, getboolfield(), getenumfield(), getfloatfield(), getintfield_default(), getstringfield(), ContentFeatures::groups, ContentFeatures::has_after_destruct, ContentFeatures::has_on_construct, ContentFeatures::has_on_destruct, ContentFeatures::is_ground_content, ContentFeatures::legacy_facedir_simple, ContentFeatures::legacy_wallmounted, ContentFeatures::leveled, ContentFeatures::leveled_max, LIGHT_MAX, ContentFeatures::light_propagates, ContentFeatures::light_source, ContentFeatures::liquid_alternative_flowing, ContentFeatures::liquid_alternative_source, ContentFeatures::liquid_move_physics, LIQUID_NONE, ContentFeatures::liquid_range, ContentFeatures::liquid_renewable, ContentFeatures::liquid_type, ContentFeatures::liquid_viscosity, ContentFeatures::mesh, ContentFeatures::move_resistance, ContentFeatures::name, NDT_NORMAL, ContentFeatures::node_box, ContentFeatures::node_dig_prediction, ContentFeatures::palette_name, ContentFeatures::param_type, ContentFeatures::param_type_2, ContentFeatures::pointable, ContentFeatures::post_effect_color, ContentFeatures::post_effect_color_shaded, read_color(), read_groups(), read_nodebox(), read_pointability_type(), read_simplesoundspec(), read_tiledef(), ContentFeatures::rightclickable, ContentFeatures::selection_box, ContentFeatures::setDefaultAlphaMode(), ContentFeatures::sound_dig, ContentFeatures::sound_dug, ContentFeatures::sound_footstep, string_to_enum(), ContentFeatures::sunlight_propagates, table, ContentFeatures::tiledef, ContentFeatures::tiledef_overlay, ContentFeatures::tiledef_special, ContentFeatures::visual_scale, ContentFeatures::walkable, warn_if_field_exists(), warningstream, and ContentFeatures::waving.
Referenced by ModApiItem::l_register_item_raw().
bool read_flags | ( | lua_State * | L, |
int | index, | ||
FlagDesc * | flagdesc, | ||
u32 * | flags, | ||
u32 * | flagmask ) |
References read_flags_table(), and readFlagString().
Referenced by getflagsfield(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), and ModApiMapgen::l_set_gen_notify().
u32 read_flags_table | ( | lua_State * | L, |
int | table, | ||
FlagDesc * | flagdesc, | ||
u32 * | flagmask ) |
References FlagDesc::flag, getboolfield(), FlagDesc::name, strlcpy, and table.
Referenced by read_flags().
void read_groups | ( | lua_State * | L, |
int | index, | ||
ItemGroupList & | 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().
bool read_hud_change | ( | lua_State * | L, |
HudElementStat & | stat, | ||
HudElement * | elem, | ||
void ** | value ) |
References HudElement::align, HudElement::dir, es_HudElementStat, HUD_ELEM_WAYPOINT, HUD_STAT_ALIGN, HUD_STAT_DIR, HUD_STAT_ITEM, HUD_STAT_NAME, HUD_STAT_NUMBER, HUD_STAT_OFFSET, HUD_STAT_POS, HUD_STAT_SCALE, HUD_STAT_SIZE, HUD_STAT_STYLE, HUD_STAT_TEXT, HUD_STAT_TEXT2, HUD_STAT_WORLD_POS, HUD_STAT_Z_INDEX, HudElementStat_END, HudElement::item, MYMAX, MYMIN, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, read_v2f(), read_v2s32(), read_v3f(), S16_MAX, S16_MIN, HudElement::scale, script_log_unique(), HudElement::size, string_to_enum(), HudElement::style, HudElement::text, HudElement::text2, HudElement::type, warningstream, HudElement::world_pos, and HudElement::z_index.
Referenced by LuaLocalPlayer::l_hud_change(), and ObjectRef::l_hud_change().
void read_hud_element | ( | lua_State * | L, |
HudElement * | elem ) |
References HudElement::align, HudElement::dir, es_HudElementType, getintfield_default(), getstringfield(), getstringfield_default(), HUD_ELEM_INVENTORY, HUD_ELEM_STATBAR, HUD_ELEM_TEXT, HUD_ELEM_WAYPOINT, HudElement::item, log_deprecated(), MYMAX, MYMIN, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, read_v2f(), read_v2s32(), read_v3f(), S16_MAX, S16_MIN, HudElement::scale, HudElement::size, string_to_enum(), HudElement::style, HudElement::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.
Referenced by LuaLocalPlayer::l_hud_add(), and ObjectRef::l_hud_add().
void read_inventory_list | ( | lua_State * | L, |
int | tableindex, | ||
Inventory * | inv, | ||
const char * | name, | ||
IGameDef * | gdef, | ||
int | forcesize ) |
References Inventory::addList(), InventoryList::changeItem(), Inventory::deleteList(), and read_items().
Referenced by NodeMetaRef::handleFromTable(), InvRef::l_set_list(), and InvRef::l_set_lists().
ItemStack read_item | ( | lua_State * | L, |
int | index, | ||
IItemDefManager * | idef ) |
References ModApiBase::checkObject(), ItemStack::deSerialize(), getintfield_default(), LuaItemStack::getItem(), getstringfield_default(), ItemStack::metadata, ItemStackMetadata::setString(), and warningstream.
Referenced by LuaItemStack::create_object(), ScriptApiItem::item_CraftPredict(), ScriptApiItem::item_OnCraft(), ScriptApiItem::item_OnDrop(), ScriptApiItem::item_OnPlace(), ScriptApiItem::item_OnSecondaryUse(), ScriptApiItem::item_OnUse(), InvRef::l_add_item(), LuaItemStack::l_add_item(), ModApiEnv::l_add_item(), InvRef::l_contains_item(), LuaItemStack::l_item_fits(), InvRef::l_remove_item(), LuaItemStack::l_replace(), InvRef::l_room_for_item(), InvRef::l_set_stack(), ObjectRef::l_set_wielded_item(), read_items(), and read_object_properties().
void read_item_definition | ( | lua_State * | L, |
int | index, | ||
const ItemDefinition & | default_def, | ||
ItemDefinition & | def ) |
References WearBarParams::BLEND_MODE_CONSTANT, check_v3f(), ItemDefinition::color, ItemDefinition::description, es_ItemType, es_TouchInteractionMode, getboolfield(), getenumfield(), getfloatfield_default(), getintfield(), getintfield_default(), getstringfield(), ItemDefinition::groups, ItemDefinition::inventory_image, ItemDefinition::inventory_overlay, ITEM_NONE, ItemDefinition::liquids_pointable, ItemDefinition::name, ItemDefinition::node_placement_prediction, ItemDefinition::palette_image, ItemDefinition::place_param2, ItemDefinition::pointabilities, TouchInteraction::pointed_node, TouchInteraction::pointed_nothing, TouchInteraction::pointed_object, ItemDefinition::range, rangelim, read_color(), read_groups(), read_pointabilities(), read_simplesoundspec(), read_tool_capabilities(), read_wear_bar_params(), ItemDefinition::short_description, ItemDefinition::sound_place, ItemDefinition::sound_place_failed, ItemDefinition::sound_use, ItemDefinition::sound_use_air, ItemDefinition::stack_max, string_to_enum(), ItemDefinition::tool_capabilities, ItemDefinition::touch_interaction, ItemDefinition::type, U16_MAX, U8_MAX, ItemDefinition::usable, ItemDefinition::wallmounted_rotate_vertical, ItemDefinition::wear_bar_params, ItemDefinition::wield_image, ItemDefinition::wield_overlay, and ItemDefinition::wield_scale.
Referenced by ModApiItem::l_register_item_raw().
References IGameDef::idef(), and read_item().
Referenced by ModApiCraft::l_get_craft_result(), and read_inventory_list().
void read_json_value | ( | lua_State * | L, |
Json::Value & | root, | ||
int | index, | ||
u16 | max_depth ) |
References read_json_value(), and TileAnimationParams::type.
Referenced by ModApiUtil::l_write_json(), and read_json_value().
NodeBox read_nodebox | ( | lua_State * | L, |
int | index ) |
References ScriptApiNode::es_NodeBoxType, NodeBox::fixed, NodeBox::getConnected(), getenumfield(), NODEBOX_CONNECTED, NODEBOX_REGULAR, NODEBOXREAD, NODEBOXREADVEC, NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.
Referenced by read_content_features().
bool read_noiseparams | ( | lua_State * | L, |
int | index, | ||
NoiseParams * | np ) |
References flagdesc_noiseparams, NoiseParams::flags, getflagsfield(), getfloatfield(), getintfield(), NoiseParams::lacunarity, NOISE_FLAG_DEFAULTS, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, read_v3f(), NoiseParams::scale, NoiseParams::seed, and NoiseParams::spread.
Referenced by LuaPerlinNoise::create_object(), LuaPerlinNoiseMap::create_object(), ModApiEnv::l_get_perlin(), ModApiEnv::l_get_perlin_map(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), ModApiMapgen::l_set_mapgen_setting_noiseparams(), ModApiMapgen::l_set_noiseparams(), and LuaSettings::l_set_np_group().
void read_object_properties | ( | lua_State * | L, |
int | index, | ||
ServerActiveObject * | sao, | ||
ObjectProperties * | prop, | ||
IItemDefManager * | idef ) |
References ACTIVEOBJECT_TYPE_PLAYER, ObjectProperties::automatic_face_movement_dir, ObjectProperties::automatic_face_movement_dir_offset, ObjectProperties::automatic_face_movement_max_rotation_per_sec, ObjectProperties::automatic_rotate, ObjectProperties::backface_culling, ObjectProperties::breath_max, BS, ObjectProperties::collideWithObjects, ObjectProperties::collisionbox, ObjectProperties::colors, ObjectProperties::damage_texture_modifier, ObjectProperties::eye_height, getboolfield(), PlayerSAO::getBreath(), getfloatfield(), ServerActiveObject::getHP(), getintfield(), ItemStack::getItemString(), getstringfield(), ActiveObject::getType(), ObjectProperties::glow, ObjectProperties::hp_max, ObjectProperties::infotext, ObjectProperties::initial_sprite_basepos, ObjectProperties::is_visible, ObjectProperties::makes_footstep_sound, ObjectProperties::mesh, ObjectProperties::nametag, ObjectProperties::nametag_bgcolor, ObjectProperties::nametag_color, ObjectProperties::physical, ObjectProperties::pointable, rangelim, read_aabb3f(), read_color(), read_item(), read_pointability_type(), read_v2f(), read_v2s16(), ObjectProperties::rotate_selectionbox, ObjectProperties::selectionbox, PlayerHPChangeReason::SET_HP_MAX, PlayerSAO::setBreath(), ServerActiveObject::setHP(), ObjectProperties::shaded, ObjectProperties::show_on_minimap, ObjectProperties::spritediv, ObjectProperties::static_save, ObjectProperties::stepheight, table, ObjectProperties::textures, U16_MAX, ObjectProperties::use_texture_alpha, ObjectProperties::visual, ObjectProperties::visual_size, ObjectProperties::wield_item, and ObjectProperties::zoom_fov.
Referenced by ObjectRef::l_set_properties(), and ScriptApiEntity::luaentity_GetProperties().
Pointabilities read_pointabilities | ( | lua_State * | L, |
int | index ) |
References Pointabilities::node_groups, Pointabilities::nodes, Pointabilities::object_groups, Pointabilities::objects, read_pointability_type(), and str_starts_with().
Referenced by LuaRaycast::create_object(), and read_item_definition().
PointabilityType read_pointability_type | ( | lua_State * | L, |
int | index ) |
References POINTABLE, POINTABLE_BLOCKING, and POINTABLE_NOT.
Referenced by read_content_features(), read_object_properties(), and read_pointabilities().
void read_server_sound_params | ( | lua_State * | L, |
int | index, | ||
ServerPlayingSound & | params ) |
References BS, ModApiBase::checkObject(), ServerPlayingSound::exclude_player, SoundSpec::fade, ServerPlayingSound::gain, getboolfield(), getfloatfield(), getfloatfield_default(), ActiveObject::getId(), ObjectRef::getobject(), getstringfield(), SoundSpec::loop, ServerPlayingSound::max_hear_distance, Object, ServerPlayingSound::object, p(), SoundSpec::pitch, ServerPlayingSound::pos, Position, read_v3f(), ServerPlayingSound::spec, SoundSpec::start_time, ServerPlayingSound::to_player, and ServerPlayingSound::type.
Referenced by ModApiServer::l_sound_play().
void read_simplesoundspec | ( | lua_State * | L, |
int | index, | ||
SoundSpec & | spec ) |
References SoundSpec::fade, SoundSpec::gain, getfloatfield(), getstringfield(), SoundSpec::name, and SoundSpec::pitch.
Referenced by ModApiClientSound::l_sound_play(), ModApiMainMenuSound::l_sound_play(), ModApiServer::l_sound_play(), read_content_features(), and read_item_definition().
TileDef read_tiledef | ( | lua_State * | L, |
int | index, | ||
u8 | drawtype, | ||
bool | special ) |
References TileDef::align_style, ALIGN_STYLE_NODE, ALIGN_STYLE_USER_DEFINED, ALIGN_STYLE_WORLD, TileDef::animation, TileDef::backface_culling, TileDef::color, getboolfield_default(), getintfield_default(), getstringfield(), TileDef::has_color, TileDef::name, NDT_FIRELIKE, NDT_LIQUID, NDT_MESH, NDT_PLANTLIKE, NDT_PLANTLIKE_ROOTED, read_animation_definition(), read_color(), TileDef::scale, TileDef::tileable_horizontal, and TileDef::tileable_vertical.
Referenced by read_content_features().
ToolCapabilities read_tool_capabilities | ( | lua_State * | L, |
int | table ) |
References ToolCapabilities::damageGroups, ToolCapabilities::full_punch_interval, getfloatfield(), getintfield(), ToolCapabilities::groupcaps, infostream, ToolCapabilities::max_drop_level, ToolGroupCap::maxlevel, ToolCapabilities::punch_attack_uses, script_get_backtrace(), table, ToolGroupCap::times, ToolGroupCap::uses, and warningstream.
Referenced by ModApiUtil::l_get_dig_params(), ModApiUtil::l_get_hit_params(), ObjectRef::l_punch(), ItemStackMetaRef::l_set_tool_capabilities(), and read_item_definition().
bool read_tree_def | ( | lua_State * | L, |
int | idx, | ||
const NodeDefManager * | ndef, | ||
treegen::TreeDef & | tree_def ) |
References treegen::TreeDef::angle, treegen::TreeDef::explicit_seed, treegen::TreeDef::fruit_chance, getboolfield(), getintfield(), getstringfield(), idx, treegen::TreeDef::initial_axiom, treegen::TreeDef::iterations, treegen::TreeDef::iterations_random_level, treegen::TreeDef::leaves2_chance, NodeResolver::m_nodenames, NodeDefManager::pendNodeResolve(), treegen::TreeDef::rules_a, treegen::TreeDef::rules_b, treegen::TreeDef::rules_c, treegen::TreeDef::rules_d, treegen::TreeDef::seed, treegen::TreeDef::thin_branches, and treegen::TreeDef::trunk_type.
Referenced by ModApiEnv::l_spawn_tree(), ModApiEnvVM::l_spawn_tree(), and read_deco_lsystem().
WearBarParams read_wear_bar_params | ( | lua_State * | L, |
int | stack_idx ) |
References blend, WearBarParams::BLEND_MODE_CONSTANT, check_field_or_nil(), WearBarParams::es_BlendMode, read_color(), and string_to_enum().
Referenced by ItemStackMetaRef::l_set_wear_bar_params(), and read_item_definition().
MapNode readnode | ( | lua_State * | L, |
int | index ) |
References CUSTOM_RIDX_READ_NODE.
Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiEnv::l_bulk_set_node(), ModApiEnv::l_bulk_swap_node(), ModApiEnv::l_get_node_boxes(), ModApiEnv::l_place_node(), ModApiEnv::l_set_node(), LuaVoxelManip::l_set_node_at(), and ModApiEnv::l_swap_node().
bool string_to_enum | ( | const EnumString * | spec, |
int & | result, | ||
const std::string & | str ) |
References EnumString::num, and EnumString::str.
Referenced by WearBarParams::deserializeJson(), get_compress_method(), getenumfield(), ModApiEnv::l_compare_block_status(), ModApiMapgen::l_get_mapgen_object(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ModApiMapgen::l_register_ore(), ModApiMapgen::l_serialize_schematic(), read_content_features(), read_hud_change(), read_hud_element(), read_item_definition(), read_wear_bar_params(), LuaParticleParams::readLuaValue(), LuaParticleParams::readLuaValue(), and LuaParticleParams::readLuaValue().
void warn_if_field_exists | ( | lua_State * | L, |
int | table, | ||
const char * | fieldname, | ||
std::string_view | name, | ||
std::string_view | message ) |
References infostream, script_get_backtrace(), table, and warningstream.
Referenced by ModApiMapgen::l_register_ore(), and read_content_features().
|
static |
Referenced by push_collision_move_result().
|
static |
Referenced by push_collision_move_result().
struct EnumString es_TileAnimationType[] |
Referenced by read_animation_definition().
const std::array<const char *, 33> object_property_keys |
Referenced by ScriptApiEntity::logDeprecationForExistingProperties().