Minetest  5.4.0
c_content.cpp File Reference
#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 <json/json.h>
+ Include dependency graph for c_content.cpp:

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, ObjectProperties *prop)
 
TileDef read_tiledef (lua_State *L, int index, u8 drawtype)
 
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_box (lua_State *L, const std::vector< aabb3f > &box)
 
void push_palette (lua_State *L, const std::vector< video::SColor > *palette)
 
void read_server_sound_params (lua_State *L, int index, ServerSoundParams &params)
 
void read_soundspec (lua_State *L, int index, SimpleSoundSpec &spec)
 
void push_soundspec (lua_State *L, const SimpleSoundSpec &spec)
 
NodeBox read_nodebox (lua_State *L, int index)
 
MapNode readnode (lua_State *L, int index, const NodeDefManager *ndef)
 
void pushnode (lua_State *L, const MapNode &n, const NodeDefManager *ndef)
 
void warn_if_field_exists (lua_State *L, int table, const char *name, const std::string &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_inventory_list (lua_State *L, Inventory *inv, const char *name)
 
void read_inventory_list (lua_State *L, int tableindex, Inventory *inv, const char *name, Server *srv, int forcesize)
 
struct TileAnimationParams read_animation_definition (lua_State *L, int index)
 
ToolCapabilities read_tool_capabilities (lua_State *L, int table)
 
void push_dig_params (lua_State *L, const DigParams &params)
 
void push_hit_params (lua_State *L, const HitParams &params)
 
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< ItemStackread_items (lua_State *L, int index, Server *srv)
 
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)
 
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, u8 recursion)
 
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)
 
HudElementStat read_hud_change (lua_State *L, HudElement *elem, void **value)
 
void push_collision_move_result (lua_State *L, const collisionMoveResult &res)
 

Variables

struct EnumString es_TileAnimationType []
 
static const char * collision_type_str []
 
static const char * collision_axis_str []
 

Macro Definition Documentation

◆ NODEBOXREAD

#define NODEBOXREAD (   n,
 
)
Value:
{ \
lua_getfield(L, index, (s)); \
if (lua_istable(L, -1)) \
(n) = read_aabb3f(L, -1, BS); \
lua_pop(L, 1); \
}
aabb3f read_aabb3f(lua_State *L, int index, f32 scale)
Definition: c_converter.cpp:360
#define BS
Definition: constants.h:74

◆ NODEBOXREADVEC

#define NODEBOXREADVEC (   n,
 
)
Value:
lua_getfield(L, index, (s)); \
if (lua_istable(L, -1)) \
(n) = read_aabb3f_vector(L, -1, BS); \
lua_pop(L, 1);
std::vector< aabb3f > read_aabb3f_vector(lua_State *L, int index, f32 scale)
Definition: c_converter.cpp:404

Function Documentation

◆ getenumfield()

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 ModApiEnvMod::l_clear_objects(), ModApiCraft::l_get_craft_result(), ModApiMapgen::l_register_decoration(), ModApiMapgen::l_register_ore(), read_biome_def(), read_content_features(), read_deco_schematic(), read_hud_element(), read_item_definition(), and read_nodebox().

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

◆ getflagsfield()

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().

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

◆ luaentity_get()

void luaentity_get ( lua_State *  L,
u16  id 
)

◆ push_box()

void push_box ( lua_State *  L,
const std::vector< aabb3f > &  box 
)

References push_aabb3f().

Referenced by push_nodebox().

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

◆ push_collision_move_result()

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, push_objectRef(), push_v3f(), push_v3s16(), setboolfield(), collisionMoveResult::standing_on_object, and collisionMoveResult::touching_ground.

Referenced by ScriptApiEntity::luaentity_Step().

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

◆ push_content_features()

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_range, ContentFeatures::liquid_renewable, ContentFeatures::liquid_type, ContentFeatures::liquid_viscosity, ContentFeatures::mesh, ContentFeatures::minimap_color, 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, push_ARGB8(), push_groups(), push_nodebox(), push_palette(), push_soundspec(), 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().

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

◆ push_dig_params()

void push_dig_params ( lua_State *  L,
const DigParams params 
)

References params, setboolfield(), setfloatfield(), and setintfield().

Referenced by ModApiUtil::l_get_dig_params().

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

◆ push_flags_string()

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().

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

◆ push_groups()

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().

+ Here is the caller graph for this function:

◆ push_hit_params()

void push_hit_params ( lua_State *  L,
const HitParams params 
)

References params, and setintfield().

Referenced by ModApiUtil::l_get_hit_params().

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

◆ push_hud_element()

void push_hud_element ( lua_State *  L,
HudElement elem 
)

References HudElement::align, HudElement::dir, es_HudElementType, HudElement::item, HudElement::name, HudElement::number, HudElement::offset, HudElement::pos, push_v2f(), push_v2s32(), push_v3f(), HudElement::scale, HudElement::size, EnumString::str, HudElement::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.

Referenced by LuaLocalPlayer::l_hud_get(), and ObjectRef::l_hud_get().

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

◆ push_inventory_list()

void push_inventory_list ( lua_State *  L,
Inventory inv,
const char *  name 
)

References InventoryList::getItem(), Inventory::getList(), InventoryList::getSize(), and push_items().

Referenced by NodeMetaRef::handleToTable(), InvRef::l_get_list(), InvRef::l_get_lists(), and ScriptApiClient::on_inventory_open().

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

◆ push_item_definition()

void push_item_definition ( lua_State *  L,
const ItemDefinition i 
)

References ItemDefinition::description, and ItemDefinition::name.

Referenced by ScriptApiClient::on_placenode().

+ Here is the caller graph for this function:

◆ push_item_definition_full()

◆ push_items()

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().

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

◆ push_json_value()

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().

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

◆ push_json_value_getdepth()

static int push_json_value_getdepth ( const Json::Value &  value)
static

Referenced by push_json_value().

+ Here is the caller graph for this function:

◆ push_json_value_helper()

static bool push_json_value_helper ( lua_State *  L,
const Json::Value &  value,
int  nullindex 
)
static

Referenced by push_json_value().

+ Here is the caller graph for this function:

◆ push_nodebox()

void push_nodebox ( lua_State *  L,
const NodeBox box 
)

References NodeBox::connect_back, NodeBox::connect_bottom, NodeBox::connect_front, NodeBox::connect_left, NodeBox::connect_right, NodeBox::connect_top, FATAL_ERROR, NodeBox::fixed, NODEBOX_CONNECTED, NODEBOX_FIXED, NODEBOX_LEVELED, NODEBOX_REGULAR, NODEBOX_WALLMOUNTED, push_aabb3f(), push_box(), NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.

Referenced by push_content_features().

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

◆ push_noiseparams()

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_float_string(), push_v3_float_string(), NoiseParams::scale, NoiseParams::seed, and NoiseParams::spread.

Referenced by ModApiMapgen::l_get_mapgen_setting_noiseparams(), ModApiMapgen::l_get_noiseparams(), and LuaSettings::l_get_np_group().

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

◆ push_object_properties()

void push_object_properties ( lua_State *  L,
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_v2s16(), push_v3f(), ObjectProperties::selectionbox, ObjectProperties::shaded, ObjectProperties::show_on_minimap, ObjectProperties::spritediv, ObjectProperties::static_save, ObjectProperties::stepheight, ObjectProperties::textures, ObjectProperties::use_texture_alpha, Optional< T >::value(), ObjectProperties::visual, ObjectProperties::visual_size, ObjectProperties::wield_item, and ObjectProperties::zoom_fov.

Referenced by ObjectRef::l_get_properties().

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

◆ push_objectRef()

void push_objectRef ( lua_State *  L,
const u16  id 
)

Referenced by ScriptApiEntity::luaentity_Add(), ScriptApiBase::objectrefGetOrCreate(), push_collision_move_result(), and push_pointed_thing().

+ Here is the caller graph for this function:

◆ push_palette()

void push_palette ( lua_State *  L,
const std::vector< video::SColor > *  palette 
)

References push_ARGB8().

Referenced by push_content_features().

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

◆ push_pointed_thing()

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.

Parameters
csmIf true, a client side pointed thing is pushed
hitpointIf 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().

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

◆ push_soundspec()

void push_soundspec ( lua_State *  L,
const SimpleSoundSpec spec 
)

References SimpleSoundSpec::fade, SimpleSoundSpec::gain, SimpleSoundSpec::name, and SimpleSoundSpec::pitch.

Referenced by push_content_features(), and push_item_definition_full().

+ Here is the caller graph for this function:

◆ push_tool_capabilities()

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().

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

◆ pushnode()

void pushnode ( lua_State *  L,
const MapNode n,
const NodeDefManager ndef 
)

References NodeDefManager::get(), MapNode::getParam1(), MapNode::getParam2(), and ContentFeatures::name.

Referenced by ModApiEnvMod::l_get_node(), LuaVoxelManip::l_get_node_at(), ModApiClient::l_get_node_or_nil(), ModApiEnvMod::l_get_node_or_nil(), ScriptApiNode::node_after_destruct(), ScriptApiNode::node_on_dig(), ScriptApiNode::node_on_flood(), ScriptApiNode::node_on_punch(), ScriptApiClient::on_dignode(), ScriptApiClient::on_punchnode(), LuaLBM::trigger(), and LuaABM::trigger().

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

◆ read_animation_definition()

struct TileAnimationParams read_animation_definition ( lua_State *  L,
int  index 
)

References Inventory::addList(), InventoryList::changeItem(), InventoryList::deleteItem(), Inventory::deleteList(), and read_items().

Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), and read_tiledef().

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

◆ read_content_features()

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_FACEDIR, CPT2_COLORED_WALLMOUNTED, CPT2_NONE, CPT_LIGHT, CPT_NONE, ContentFeatures::damage_per_second, ContentFeatures::diggable, ContentFeatures::drawtype, ContentFeatures::drowning, 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, LIQUID_NONE, ContentFeatures::liquid_range, ContentFeatures::liquid_renewable, ContentFeatures::liquid_type, ContentFeatures::liquid_viscosity, ContentFeatures::mesh, 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, read_color(), read_groups(), read_nodebox(), read_soundspec(), 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 ModApiItemMod::l_register_item_raw().

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

◆ read_flags()

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().

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

◆ read_flags_table()

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().

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

◆ read_groups()

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().

+ Here is the caller graph for this function:

◆ read_hud_change()

HudElementStat read_hud_change ( lua_State *  L,
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_TEXT, HUD_STAT_TEXT2, HUD_STAT_WORLD_POS, HUD_STAT_Z_INDEX, HudElement::item, 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::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.

Referenced by LuaLocalPlayer::l_hud_change(), and ObjectRef::l_hud_change().

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

◆ read_hud_element()

void read_hud_element ( lua_State *  L,
HudElement elem 
)

References HudElement::align, HudElement::dir, es_HudElementType, getenumfield(), getintfield_default(), getstringfield_default(), 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, HudElement::text, HudElement::text2, HudElement::type, HudElement::world_pos, and HudElement::z_index.

Referenced by LuaLocalPlayer::l_hud_add(), and ObjectRef::l_hud_add().

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

◆ read_inventory_list()

void read_inventory_list ( lua_State *  L,
int  tableindex,
Inventory inv,
const char *  name,
Server srv,
int  forcesize 
)

Referenced by NodeMetaRef::handleFromTable(), InvRef::l_set_list(), and InvRef::l_set_lists().

+ Here is the caller graph for this function:

◆ read_item()

◆ read_item_definition()

◆ read_items()

std::vector<ItemStack> read_items ( lua_State *  L,
int  index,
Server srv 
)

References IGameDef::idef(), and read_item().

Referenced by ModApiCraft::l_get_craft_result(), and read_animation_definition().

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

◆ read_json_value()

void read_json_value ( lua_State *  L,
Json::Value &  root,
int  index,
u8  recursion 
)

References TileAnimationParams::type.

Referenced by ModApiUtil::l_write_json().

+ Here is the caller graph for this function:

◆ read_nodebox()

NodeBox read_nodebox ( lua_State *  L,
int  index 
)

References NodeBox::connect_back, NodeBox::connect_bottom, NodeBox::connect_front, NodeBox::connect_left, NodeBox::connect_right, NodeBox::connect_top, NodeBox::disconnected, NodeBox::disconnected_back, NodeBox::disconnected_bottom, NodeBox::disconnected_front, NodeBox::disconnected_left, NodeBox::disconnected_right, NodeBox::disconnected_sides, NodeBox::disconnected_top, ScriptApiNode::es_NodeBoxType, NodeBox::fixed, getenumfield(), NODEBOX_REGULAR, NODEBOXREAD, NODEBOXREADVEC, NodeBox::type, NodeBox::wall_bottom, NodeBox::wall_side, and NodeBox::wall_top.

Referenced by read_content_features().

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

◆ read_noiseparams()

bool read_noiseparams ( lua_State *  L,
int  index,
NoiseParams np 
)

◆ read_object_properties()

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(), ServerActiveObject::getEnv(), getfloatfield(), ServerEnvironment::getGameDef(), 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, nullopt, ObjectProperties::physical, ObjectProperties::pointable, rangelim, read_aabb3f(), read_color(), read_item(), read_v2f(), read_v2s16(), ObjectProperties::selectionbox, Server::SendPlayerHPOrDie(), PlayerHPChangeReason::SET_HP, 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().

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

◆ read_server_sound_params()

void read_server_sound_params ( lua_State *  L,
int  index,
ServerSoundParams params 
)

References BS, ObjectRef::checkobject(), getboolfield(), getfloatfield(), getfloatfield_default(), ActiveObject::getId(), ObjectRef::getobject(), getstringfield(), p(), params, read_v3f(), ServerSoundParams::SSP_OBJECT, and ServerSoundParams::SSP_POSITIONAL.

Referenced by ModApiServer::l_sound_play().

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

◆ read_soundspec()

void read_soundspec ( lua_State *  L,
int  index,
SimpleSoundSpec spec 
)

References SimpleSoundSpec::fade, SimpleSoundSpec::gain, getfloatfield(), getstringfield(), SimpleSoundSpec::name, and SimpleSoundSpec::pitch.

Referenced by ModApiClient::l_sound_play(), ModApiServer::l_sound_play(), ModApiSound::l_sound_play(), read_content_features(), and read_item_definition().

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

◆ read_tiledef()

TileDef read_tiledef ( lua_State *  L,
int  index,
u8  drawtype 
)

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().

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

◆ read_tool_capabilities()

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().

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

◆ readnode()

MapNode readnode ( lua_State *  L,
int  index,
const NodeDefManager ndef 
)

References CONTENT_IGNORE, and NodeDefManager::getId().

Referenced by ModApiParticles::l_add_particle(), ModApiParticlesLocal::l_add_particle(), ModApiParticles::l_add_particlespawner(), ModApiParticlesLocal::l_add_particlespawner(), ModApiEnvMod::l_bulk_set_node(), ModApiEnvMod::l_place_node(), ModApiEnvMod::l_set_node(), LuaVoxelManip::l_set_node_at(), and ModApiEnvMod::l_swap_node().

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

◆ string_to_enum()

bool string_to_enum ( const EnumString spec,
int &  result,
const std::string &  str 
)

References EnumString::num, and EnumString::str.

Referenced by getenumfield(), ModApiMapgen::l_get_mapgen_object(), ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ModApiMapgen::l_serialize_schematic(), read_content_features(), and read_hud_change().

+ Here is the caller graph for this function:

◆ warn_if_field_exists()

void warn_if_field_exists ( lua_State *  L,
int  table,
const char *  name,
const std::string &  message 
)

References infostream, script_get_backtrace(), table, and warningstream.

Referenced by ModApiMapgen::l_register_ore(), and read_content_features().

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

Variable Documentation

◆ collision_axis_str

const char* collision_axis_str[]
static
Initial value:
= {
"x",
"y",
"z",
}

Referenced by push_collision_move_result().

◆ collision_type_str

const char* collision_type_str[]
static
Initial value:
= {
"node",
"object",
}

Referenced by push_collision_move_result().

◆ es_TileAnimationType

struct EnumString es_TileAnimationType[]
Initial value:
=
{
{TAT_NONE, "none"},
{TAT_VERTICAL_FRAMES, "vertical_frames"},
{TAT_SHEET_2D, "sheet_2d"},
{0, NULL},
}
@ TAT_NONE
Definition: tileanimation.h:27
@ TAT_SHEET_2D
Definition: tileanimation.h:29
@ TAT_VERTICAL_FRAMES
Definition: tileanimation.h:28