#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>
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 ¶ms) |
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 ¶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, 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 [] |
#define NODEBOXREAD | ( | n, | |
s | |||
) |
#define NODEBOXREADVEC | ( | n, | |
s | |||
) |
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().
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_box | ( | lua_State * | L, |
const std::vector< aabb3f > & | box | ||
) |
References push_aabb3f().
Referenced by push_nodebox().
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().
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().
void push_dig_params | ( | lua_State * | L, |
const DigParams & | params | ||
) |
References params, setboolfield(), setfloatfield(), and setintfield().
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 params, and setintfield().
Referenced by ModApiUtil::l_get_hit_params().
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().
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().
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, ItemDefinition::groups, ItemDefinition::inventory_image, ItemDefinition::inventory_overlay, ItemDefinition::liquids_pointable, ItemDefinition::name, ItemDefinition::node_placement_prediction, ItemDefinition::palette_image, push_ARGB8(), push_groups(), push_soundspec(), push_tool_capabilities(), push_v3f(), ItemDefinition::short_description, ItemDefinition::sound_place, ItemDefinition::sound_place_failed, ItemDefinition::stack_max, EnumString::str, ItemDefinition::tool_capabilities, ItemDefinition::type, ItemDefinition::usable, 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 |
|
static |
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().
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().
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().
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_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_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().
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 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().
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().
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().
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().
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().
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().
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().
ItemStack read_item | ( | lua_State * | L, |
int | index, | ||
IItemDefManager * | idef | ||
) |
References LuaItemStack::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(), ModApiEnvMod::l_add_item(), InvRef::l_add_item(), LuaItemStack::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 check_v3f(), ItemDefinition::color, ItemDefinition::description, es_ItemType, getboolfield(), getenumfield(), getfloatfield_default(), 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::range, rangelim, read_color(), read_groups(), read_soundspec(), read_tool_capabilities(), ItemDefinition::short_description, ItemDefinition::sound_place, ItemDefinition::sound_place_failed, ItemDefinition::stack_max, ItemDefinition::tool_capabilities, ItemDefinition::type, U16_MAX, ItemDefinition::usable, ItemDefinition::wield_image, ItemDefinition::wield_overlay, and ItemDefinition::wield_scale.
Referenced by ModApiItemMod::l_register_item_raw().
References IGameDef::idef(), and read_item().
Referenced by ModApiCraft::l_get_craft_result(), and read_animation_definition().
void read_json_value | ( | lua_State * | L, |
Json::Value & | root, | ||
int | index, | ||
u8 | recursion | ||
) |
References TileAnimationParams::type.
Referenced by ModApiUtil::l_write_json().
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().
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(), ModApiEnvMod::l_get_perlin(), ModApiEnvMod::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(), 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().
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().
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().
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().
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().
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().
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().
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().
|
static |
Referenced by push_collision_move_result().
|
static |
Referenced by push_collision_move_result().
struct EnumString es_TileAnimationType[] |