Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
ObjectRef Class Reference

#include <l_object.h>

+ Inheritance diagram for ObjectRef:
+ Collaboration diagram for ObjectRef:

Public Member Functions

 ObjectRef (ServerActiveObject *object)
 
 ~ObjectRef ()=default
 

Static Public Member Functions

static void create (lua_State *L, ServerActiveObject *object)
 
static void set_null (lua_State *L, void *expect)
 
static void Register (lua_State *L)
 
static ServerActiveObjectgetobject (ObjectRef *ref)
 
- Static Public Member Functions inherited from ModApiBase
static ScriptApiBasegetScriptApiBase (lua_State *L)
 
static ServergetServer (lua_State *L)
 
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
 
static EmergeThreadgetEmergeThread (lua_State *L)
 
static IGameDefgetGameDef (lua_State *L)
 
static EnvironmentgetEnv (lua_State *L)
 
static std::string getCurrentModPath (lua_State *L)
 
template<typename T >
static T * getScriptApi (lua_State *L)
 
static bool registerFunction (lua_State *L, const char *name, lua_CFunction func, int top)
 
static void registerClass (lua_State *L, const char *name, const luaL_Reg *methods, const luaL_Reg *metamethods)
 
template<typename T >
static T * checkObject (lua_State *L, int narg)
 
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions.
 

Static Public Attributes

static const char className [] = "ObjectRef"
 

Static Private Member Functions

static LuaEntitySAOgetluaobject (ObjectRef *ref)
 
static PlayerSAOgetplayersao (ObjectRef *ref)
 
static RemotePlayergetplayer (ObjectRef *ref)
 
static int gc_object (lua_State *L)
 
static int l_remove (lua_State *L)
 
static int l_is_valid (lua_State *L)
 
static int l_get_pos (lua_State *L)
 
static int l_set_pos (lua_State *L)
 
static int l_add_pos (lua_State *L)
 
static int l_move_to (lua_State *L)
 
static int l_punch (lua_State *L)
 
static int l_right_click (lua_State *L)
 
static int l_set_hp (lua_State *L)
 
static int l_get_hp (lua_State *L)
 
static int l_get_inventory (lua_State *L)
 
static int l_get_wield_list (lua_State *L)
 
static int l_get_wield_index (lua_State *L)
 
static int l_get_wielded_item (lua_State *L)
 
static int l_set_wielded_item (lua_State *L)
 
static int l_set_armor_groups (lua_State *L)
 
static int l_get_armor_groups (lua_State *L)
 
static int l_set_physics_override (lua_State *L)
 
static int l_get_physics_override (lua_State *L)
 
static int l_set_animation (lua_State *L)
 
static int l_set_animation_frame_speed (lua_State *L)
 
static int l_get_animation (lua_State *L)
 
static int l_set_bone_position (lua_State *L)
 
static int l_get_bone_position (lua_State *L)
 
static int l_set_bone_override (lua_State *L)
 
static int l_get_bone_override (lua_State *L)
 
static int l_get_bone_overrides (lua_State *L)
 
static int l_set_attach (lua_State *L)
 
static int l_get_attach (lua_State *L)
 
static int l_get_children (lua_State *L)
 
static int l_set_detach (lua_State *L)
 
static int l_set_properties (lua_State *L)
 
static int l_get_properties (lua_State *L)
 
static int l_set_observers (lua_State *L)
 
static int l_get_observers (lua_State *L)
 
static int l_get_effective_observers (lua_State *L)
 
static int l_is_player (lua_State *L)
 
static int l_set_velocity (lua_State *L)
 
static int l_add_velocity (lua_State *L)
 
static int l_get_velocity (lua_State *L)
 
static int l_set_acceleration (lua_State *L)
 
static int l_get_acceleration (lua_State *L)
 
static int l_set_rotation (lua_State *L)
 
static int l_get_rotation (lua_State *L)
 
static int l_set_yaw (lua_State *L)
 
static int l_get_yaw (lua_State *L)
 
static int l_set_texture_mod (lua_State *L)
 
static int l_get_texture_mod (lua_State *L)
 
static int l_set_sprite (lua_State *L)
 
static int l_get_entity_name (lua_State *L)
 
static int l_get_luaentity (lua_State *L)
 
static int l_get_player_name (lua_State *L)
 
static int l_get_fov (lua_State *L)
 
static int l_get_look_dir (lua_State *L)
 
static int l_get_look_pitch (lua_State *L)
 
static int l_get_look_yaw (lua_State *L)
 
static int l_get_look_vertical (lua_State *L)
 
static int l_get_look_horizontal (lua_State *L)
 
static int l_set_fov (lua_State *L)
 
static int l_set_look_vertical (lua_State *L)
 
static int l_set_look_horizontal (lua_State *L)
 
static int l_set_look_pitch (lua_State *L)
 
static int l_set_look_yaw (lua_State *L)
 
static int l_set_breath (lua_State *L)
 
static int l_get_breath (lua_State *L)
 
static int l_set_attribute (lua_State *L)
 
static int l_get_attribute (lua_State *L)
 
static int l_get_meta (lua_State *L)
 
static int l_set_inventory_formspec (lua_State *L)
 
static int l_get_inventory_formspec (lua_State *L)
 
static int l_set_formspec_prepend (lua_State *L)
 
static int l_get_formspec_prepend (lua_State *L)
 
static int l_get_player_control (lua_State *L)
 
static int l_get_player_control_bits (lua_State *L)
 
static int l_hud_add (lua_State *L)
 
static int l_hud_remove (lua_State *L)
 
static int l_hud_change (lua_State *L)
 
static u32 hud_get_next_id (lua_State *L)
 
static int l_hud_get (lua_State *L)
 
static int l_hud_get_all (lua_State *L)
 
static int l_hud_set_flags (lua_State *L)
 
static int l_hud_get_flags (lua_State *L)
 
static int l_hud_set_hotbar_itemcount (lua_State *L)
 
static int l_hud_get_hotbar_itemcount (lua_State *L)
 
static int l_hud_set_hotbar_image (lua_State *L)
 
static int l_hud_get_hotbar_image (lua_State *L)
 
static int l_hud_set_hotbar_selected_image (lua_State *L)
 
static int l_hud_get_hotbar_selected_image (lua_State *L)
 
static int l_set_sky (lua_State *L)
 
static int l_get_sky (lua_State *L)
 
static int l_get_sky_color (lua_State *L)
 
static int l_set_sun (lua_State *L)
 
static int l_get_sun (lua_State *L)
 
static int l_set_moon (lua_State *L)
 
static int l_get_moon (lua_State *L)
 
static int l_set_stars (lua_State *L)
 
static int l_get_stars (lua_State *L)
 
static int l_set_clouds (lua_State *L)
 
static int l_get_clouds (lua_State *L)
 
static int l_override_day_night_ratio (lua_State *L)
 
static int l_get_day_night_ratio (lua_State *L)
 
static int l_set_local_animation (lua_State *L)
 
static int l_get_local_animation (lua_State *L)
 
static int l_set_eye_offset (lua_State *L)
 
static int l_get_eye_offset (lua_State *L)
 
static int l_set_nametag_attributes (lua_State *L)
 
static int l_get_nametag_attributes (lua_State *L)
 
static int l_send_mapblock (lua_State *L)
 
static int l_set_minimap_modes (lua_State *L)
 
static int l_set_lighting (lua_State *L)
 
static int l_get_lighting (lua_State *L)
 
static int l_respawn (lua_State *L)
 
static int l_set_flags (lua_State *L)
 
static int l_get_flags (lua_State *L)
 

Private Attributes

ServerActiveObjectm_object = nullptr
 

Static Private Attributes

static luaL_Reg methods []
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ObjectRef()

ObjectRef::ObjectRef ( ServerActiveObject * object)

Referenced by create().

+ Here is the caller graph for this function:

◆ ~ObjectRef()

ObjectRef::~ObjectRef ( )
default

Member Function Documentation

◆ create()

void ObjectRef::create ( lua_State * L,
ServerActiveObject * object )
static

References ObjectRef(), and className.

Referenced by ScriptApiBase::addObjectReference(), and ScriptApiBase::objectrefGetOrCreate().

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

◆ gc_object()

int ObjectRef::gc_object ( lua_State * L)
staticprivate

Referenced by Register().

+ Here is the caller graph for this function:

◆ getluaobject()

LuaEntitySAO * ObjectRef::getluaobject ( ObjectRef * ref)
staticprivate

References ACTIVEOBJECT_TYPE_LUAENTITY, getobject(), and ActiveObject::getType().

Referenced by l_get_acceleration(), l_get_entity_name(), l_get_luaentity(), l_get_rotation(), l_get_texture_mod(), l_get_yaw(), l_set_acceleration(), l_set_rotation(), l_set_sprite(), l_set_texture_mod(), l_set_velocity(), and l_set_yaw().

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

◆ getobject()

◆ getplayer()

◆ getplayersao()

PlayerSAO * ObjectRef::getplayersao ( ObjectRef * ref)
staticprivate

References ACTIVEOBJECT_TYPE_PLAYER, getobject(), and ActiveObject::getType().

Referenced by getplayer(), l_get_attribute(), l_get_breath(), l_get_flags(), l_get_look_dir(), l_get_look_horizontal(), l_get_look_pitch(), l_get_look_vertical(), l_get_look_yaw(), l_get_meta(), l_respawn(), l_set_attribute(), l_set_breath(), l_set_flags(), l_set_look_horizontal(), l_set_look_pitch(), l_set_look_vertical(), l_set_look_yaw(), and l_set_physics_override().

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

◆ hud_get_next_id()

static u32 ObjectRef::hud_get_next_id ( lua_State * L)
staticprivate

◆ l_add_pos()

int ObjectRef::l_add_pos ( lua_State * L)
staticprivate

References ServerActiveObject::addPos(), checkFloatPos(), ModApiBase::checkObject(), getobject(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_add_velocity()

int ObjectRef::l_add_velocity ( lua_State * L)
staticprivate

◆ l_get_acceleration()

int ObjectRef::l_get_acceleration ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), LuaEntitySAO::getAcceleration(), getluaobject(), NO_MAP_LOCK_REQUIRED, and pushFloatPos().

+ Here is the call graph for this function:

◆ l_get_animation()

int ObjectRef::l_get_animation ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getAnimation(), getobject(), NO_MAP_LOCK_REQUIRED, and push_v2f().

+ Here is the call graph for this function:

◆ l_get_armor_groups()

int ObjectRef::l_get_armor_groups ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getArmorGroups(), getobject(), NO_MAP_LOCK_REQUIRED, and push_groups().

+ Here is the call graph for this function:

◆ l_get_attach()

int ObjectRef::l_get_attach ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), GET_ENV_PTR, ActiveObject::getAttachment(), getobject(), ModApiBase::getScriptApiBase(), ScriptApiBase::objectrefGetOrCreate(), and push_v3f().

+ Here is the call graph for this function:

◆ l_get_attribute()

int ObjectRef::l_get_attribute ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerSAO::getMeta(), getplayersao(), IMetadata::getStringToRef(), and log_deprecated().

+ Here is the call graph for this function:

◆ l_get_bone_override()

int ObjectRef::l_get_bone_override ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getBoneOverride(), getobject(), NO_MAP_LOCK_REQUIRED, push_bone_override(), and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_get_bone_overrides()

int ObjectRef::l_get_bone_overrides ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getBoneOverrides(), getobject(), NO_MAP_LOCK_REQUIRED, and push_bone_override().

+ Here is the call graph for this function:

◆ l_get_bone_position()

int ObjectRef::l_get_bone_position ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getBoneOverride(), getobject(), log_deprecated(), BoneOverride::RotationProperty::next_radians, NO_MAP_LOCK_REQUIRED, BoneOverride::position, push_v3f(), LuaHelper::readParam(), BoneOverride::rotation, and BoneOverride::PositionProperty::vector.

+ Here is the call graph for this function:

◆ l_get_breath()

int ObjectRef::l_get_breath ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerSAO::getBreath(), getplayersao(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_children()

int ObjectRef::l_get_children ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), GET_ENV_PTR, ServerActiveObject::getAttachmentChildIds(), getobject(), ModApiBase::getScriptApiBase(), and ScriptApiBase::objectrefGetOrCreate().

+ Here is the call graph for this function:

◆ l_get_clouds()

int ObjectRef::l_get_clouds ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), CloudParams::color_ambient, CloudParams::color_bright, CloudParams::color_shadow, CloudParams::density, RemotePlayer::getCloudParams(), getplayer(), CloudParams::height, NO_MAP_LOCK_REQUIRED, push_ARGB8(), CloudParams::speed, and CloudParams::thickness.

+ Here is the call graph for this function:

◆ l_get_day_night_ratio()

int ObjectRef::l_get_day_night_ratio ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getDayNightRatio(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_effective_observers()

int ObjectRef::l_get_effective_observers ( lua_State * L)
staticprivate

References get_observers(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_entity_name()

int ObjectRef::l_get_entity_name ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), LuaEntitySAO::getName(), log_deprecated(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_eye_offset()

int ObjectRef::l_get_eye_offset ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::eye_offset_first, Player::eye_offset_third, Player::eye_offset_third_front, getplayer(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_flags()

int ObjectRef::l_get_flags ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_formspec_prepend()

int ObjectRef::l_get_formspec_prepend ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::formspec_prepend, getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_fov()

int ObjectRef::l_get_fov ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getFov(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_hp()

int ObjectRef::l_get_hp ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ServerActiveObject::getHP(), getobject(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_inventory()

int ObjectRef::l_get_inventory ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), InvRef::create(), ServerActiveObject::getInventoryLocation(), getobject(), ModApiBase::getServerInventoryMgr(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_inventory_formspec()

int ObjectRef::l_get_inventory_formspec ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), Player::inventory_formspec, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_lighting()

◆ l_get_local_animation()

int ObjectRef::l_get_local_animation ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getLocalAnimations(), getplayer(), NO_MAP_LOCK_REQUIRED, and push_v2f().

+ Here is the call graph for this function:

◆ l_get_look_dir()

int ObjectRef::l_get_look_dir ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), PlayerSAO::getRadLookPitchDep(), UnitSAO::getRadYawDep(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_look_horizontal()

int ObjectRef::l_get_look_horizontal ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), UnitSAO::getRadRotation(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_look_pitch()

int ObjectRef::l_get_look_pitch ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), PlayerSAO::getRadLookPitchDep(), log_deprecated(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_look_vertical()

int ObjectRef::l_get_look_vertical ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), PlayerSAO::getRadLookPitch(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_look_yaw()

int ObjectRef::l_get_look_yaw ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), UnitSAO::getRadYawDep(), log_deprecated(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_luaentity()

int ObjectRef::l_get_luaentity ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ActiveObject::getId(), getluaobject(), luaentity_get(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_meta()

int ObjectRef::l_get_meta ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerMetaRef::create(), ModApiBase::getEnv(), Player::getName(), PlayerSAO::getPlayer(), getplayersao(), and ModApiBase::getServer().

+ Here is the call graph for this function:

◆ l_get_moon()

int ObjectRef::l_get_moon ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getMoonParams(), getplayer(), NO_MAP_LOCK_REQUIRED, MoonParams::scale, MoonParams::texture, MoonParams::tonemap, and MoonParams::visible.

+ Here is the call graph for this function:

◆ l_get_nametag_attributes()

int ObjectRef::l_get_nametag_attributes ( lua_State * L)
staticprivate

References ServerActiveObject::accessObjectProperties(), ModApiBase::checkObject(), getobject(), ObjectProperties::nametag, ObjectProperties::nametag_bgcolor, ObjectProperties::nametag_color, NO_MAP_LOCK_REQUIRED, and push_ARGB8().

+ Here is the call graph for this function:

◆ l_get_observers()

int ObjectRef::l_get_observers ( lua_State * L)
staticprivate

References get_observers(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_physics_override()

int ObjectRef::l_get_physics_override ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), NO_MAP_LOCK_REQUIRED, and Player::physics_override.

+ Here is the call graph for this function:

◆ l_get_player_control()

int ObjectRef::l_get_player_control ( lua_State * L)
staticprivate

References PlayerControl::aux1, ModApiBase::checkObject(), PlayerControl::dig, PlayerControl::direction_keys, PlayerControl::getMovement(), getplayer(), Player::getPlayerControl(), PlayerControl::jump, NO_MAP_LOCK_REQUIRED, PlayerControl::place, PlayerControl::sneak, and PlayerControl::zoom.

+ Here is the call graph for this function:

◆ l_get_player_control_bits()

int ObjectRef::l_get_player_control_bits ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerControl::direction_keys, getplayer(), Player::getPlayerControl(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_player_name()

int ObjectRef::l_get_player_name ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getName(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_pos()

int ObjectRef::l_get_pos ( lua_State * L)
staticprivate

References BS, ModApiBase::checkObject(), ServerActiveObject::getBasePosition(), getobject(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_properties()

int ObjectRef::l_get_properties ( lua_State * L)
staticprivate

References ServerActiveObject::accessObjectProperties(), ModApiBase::checkObject(), getobject(), NO_MAP_LOCK_REQUIRED, and push_object_properties().

+ Here is the call graph for this function:

◆ l_get_rotation()

int ObjectRef::l_get_rotation ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), UnitSAO::getRotation(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_sky()

int ObjectRef::l_get_sky ( lua_State * L)
staticprivate

◆ l_get_sky_color()

int ObjectRef::l_get_sky_color ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), RemotePlayer::getSkyParams(), log_deprecated(), NO_MAP_LOCK_REQUIRED, and push_sky_color().

+ Here is the call graph for this function:

◆ l_get_stars()

int ObjectRef::l_get_stars ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), StarParams::count, StarParams::day_opacity, getplayer(), RemotePlayer::getStarParams(), NO_MAP_LOCK_REQUIRED, push_ARGB8(), StarParams::scale, StarParams::starcolor, and StarParams::visible.

+ Here is the call graph for this function:

◆ l_get_sun()

int ObjectRef::l_get_sun ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), RemotePlayer::getSunParams(), NO_MAP_LOCK_REQUIRED, SunParams::scale, SunParams::sunrise, SunParams::sunrise_visible, SunParams::texture, SunParams::tonemap, and SunParams::visible.

+ Here is the call graph for this function:

◆ l_get_texture_mod()

int ObjectRef::l_get_texture_mod ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), LuaEntitySAO::getTextureMod(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_velocity()

int ObjectRef::l_get_velocity ( lua_State * L)
staticprivate

References ACTIVEOBJECT_TYPE_LUAENTITY, ACTIVEOBJECT_TYPE_PLAYER, BS, ModApiBase::checkObject(), getobject(), Player::getSpeed(), ActiveObject::getType(), LuaEntitySAO::getVelocity(), NO_MAP_LOCK_REQUIRED, push_v3f(), and pushFloatPos().

+ Here is the call graph for this function:

◆ l_get_wield_index()

int ObjectRef::l_get_wield_index ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getobject(), ServerActiveObject::getWieldIndex(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_wield_list()

int ObjectRef::l_get_wield_list ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getobject(), ServerActiveObject::getWieldList(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_wielded_item()

int ObjectRef::l_get_wielded_item ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), LuaItemStack::create(), getobject(), ServerActiveObject::getWieldedItem(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_yaw()

int ObjectRef::l_get_yaw ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), UnitSAO::getRotation(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_add()

int ObjectRef::l_hud_add ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), Server::hudAdd(), NO_MAP_LOCK_REQUIRED, read_hud_element(), and U32_MAX.

+ Here is the call graph for this function:

◆ l_hud_change()

int ObjectRef::l_hud_change ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getHud(), getplayer(), ModApiBase::getServer(), Server::hudChange(), NO_MAP_LOCK_REQUIRED, and read_hud_change().

+ Here is the call graph for this function:

◆ l_hud_get()

int ObjectRef::l_hud_get ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getHud(), getplayer(), NO_MAP_LOCK_REQUIRED, and push_hud_element().

+ Here is the call graph for this function:

◆ l_hud_get_all()

int ObjectRef::l_hud_get_all ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), Player::hudApply(), NO_MAP_LOCK_REQUIRED, and push_hud_element().

+ Here is the call graph for this function:

◆ l_hud_get_flags()

int ObjectRef::l_hud_get_flags ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), es_HudBuiltinElement, getplayer(), Player::hud_flags, NO_MAP_LOCK_REQUIRED, EnumString::num, and EnumString::str.

+ Here is the call graph for this function:

◆ l_hud_get_hotbar_image()

int ObjectRef::l_hud_get_hotbar_image ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getHotbarImage(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_get_hotbar_itemcount()

int ObjectRef::l_hud_get_hotbar_itemcount ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getMaxHotbarItemcount(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_get_hotbar_selected_image()

int ObjectRef::l_hud_get_hotbar_selected_image ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getHotbarSelectedImage(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_remove()

int ObjectRef::l_hud_remove ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_set_flags()

int ObjectRef::l_hud_set_flags ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), es_HudBuiltinElement, getboolfield(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, EnumString::num, and EnumString::str.

+ Here is the call graph for this function:

◆ l_hud_set_hotbar_image()

int ObjectRef::l_hud_set_hotbar_image ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), Server::hudSetHotbarImage(), NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_hud_set_hotbar_itemcount()

int ObjectRef::l_hud_set_hotbar_itemcount ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_hud_set_hotbar_selected_image()

int ObjectRef::l_hud_set_hotbar_selected_image ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), Server::hudSetHotbarSelectedImage(), NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_is_player()

int ObjectRef::l_is_player ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_is_valid()

int ObjectRef::l_is_valid ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), and getobject().

+ Here is the call graph for this function:

◆ l_move_to()

int ObjectRef::l_move_to ( lua_State * L)
staticprivate

References checkFloatPos(), ModApiBase::checkObject(), getobject(), ServerActiveObject::moveTo(), NO_MAP_LOCK_REQUIRED, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_override_day_night_ratio()

int ObjectRef::l_override_day_night_ratio ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, Server::overrideDayNightRatio(), and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_punch()

int ObjectRef::l_punch ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), dir(), ServerActiveObject::getBasePosition(), getobject(), NO_MAP_LOCK_REQUIRED, ServerActiveObject::punch(), read_tool_capabilities(), and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_remove()

int ObjectRef::l_remove ( lua_State * L)
staticprivate

References ACTIVEOBJECT_TYPE_PLAYER, ModApiBase::checkObject(), GET_ENV_PTR, ActiveObject::getId(), getobject(), ActiveObject::getType(), ServerActiveObject::markForRemoval(), and verbosestream.

+ Here is the call graph for this function:

◆ l_respawn()

int ObjectRef::l_respawn ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_right_click()

int ObjectRef::l_right_click ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getobject(), NO_MAP_LOCK_REQUIRED, and ServerActiveObject::rightClick().

+ Here is the call graph for this function:

◆ l_send_mapblock()

int ObjectRef::l_send_mapblock ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), RemotePlayer::getPeerId(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_v3s16(), and Server::SendBlock().

+ Here is the call graph for this function:

◆ l_set_acceleration()

int ObjectRef::l_set_acceleration ( lua_State * L)
staticprivate

References checkFloatPos(), ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, and LuaEntitySAO::setAcceleration().

+ Here is the call graph for this function:

◆ l_set_animation()

int ObjectRef::l_set_animation ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getobject(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and ServerActiveObject::setAnimation().

+ Here is the call graph for this function:

◆ l_set_animation_frame_speed()

int ObjectRef::l_set_animation_frame_speed ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getobject(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and ServerActiveObject::setAnimationSpeed().

+ Here is the call graph for this function:

◆ l_set_armor_groups()

int ObjectRef::l_set_armor_groups ( lua_State * L)
staticprivate

References ACTIVEOBJECT_TYPE_PLAYER, ModApiBase::checkObject(), g_settings, Settings::getBool(), getobject(), ActiveObject::getType(), infostream, itemgroup_get(), NO_MAP_LOCK_REQUIRED, read_groups(), script_get_backtrace(), ServerActiveObject::setArmorGroups(), and warningstream.

+ Here is the call graph for this function:

◆ l_set_attach()

int ObjectRef::l_set_attach ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), GET_ENV_PTR, ActiveObject::getId(), getobject(), LuaHelper::readParam(), and ActiveObject::setAttachment().

+ Here is the call graph for this function:

◆ l_set_attribute()

int ObjectRef::l_set_attribute ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerSAO::getMeta(), getplayersao(), log_deprecated(), IMetadata::removeString(), and SimpleMetadata::setString().

+ Here is the call graph for this function:

◆ l_set_bone_override()

int ObjectRef::l_set_bone_override ( lua_State * L)
staticprivate

◆ l_set_bone_position()

◆ l_set_breath()

int ObjectRef::l_set_breath ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), NO_MAP_LOCK_REQUIRED, and PlayerSAO::setBreath().

+ Here is the call graph for this function:

◆ l_set_clouds()

int ObjectRef::l_set_clouds ( lua_State * L)
staticprivate

◆ l_set_detach()

int ObjectRef::l_set_detach ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), ActiveObject::clearParentAttachment(), GET_ENV_PTR, and getobject().

+ Here is the call graph for this function:

◆ l_set_eye_offset()

int ObjectRef::l_set_eye_offset ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, rangelim, LuaHelper::readParam(), and Server::setPlayerEyeOffset().

+ Here is the call graph for this function:

◆ l_set_flags()

int ObjectRef::l_set_flags ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getboolfield_default(), getplayersao(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_set_formspec_prepend()

int ObjectRef::l_set_formspec_prepend ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::formspec_prepend, Player::getName(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and Server::reportFormspecPrependModified().

+ Here is the call graph for this function:

◆ l_set_fov()

int ObjectRef::l_set_fov ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), PlayerFovSpec::fov, RemotePlayer::getPeerId(), getplayer(), ModApiBase::getServer(), PlayerFovSpec::is_multiplier, NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), Server::SendPlayerFov(), Player::setFov(), and PlayerFovSpec::transition_time.

+ Here is the call graph for this function:

◆ l_set_hp()

int ObjectRef::l_set_hp ( lua_State * L)
staticprivate

◆ l_set_inventory_formspec()

int ObjectRef::l_set_inventory_formspec ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), Player::getName(), getplayer(), ModApiBase::getServer(), Player::inventory_formspec, NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and Server::reportInventoryFormspecModified().

+ Here is the call graph for this function:

◆ l_set_lighting()

◆ l_set_local_animation()

int ObjectRef::l_set_local_animation ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_v2f(), LuaHelper::readParam(), and Server::setLocalPlayerAnimations().

+ Here is the call graph for this function:

◆ l_set_look_horizontal()

int ObjectRef::l_set_look_horizontal ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and PlayerSAO::setPlayerYawAndSend().

+ Here is the call graph for this function:

◆ l_set_look_pitch()

int ObjectRef::l_set_look_pitch ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), log_deprecated(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and PlayerSAO::setLookPitchAndSend().

+ Here is the call graph for this function:

◆ l_set_look_vertical()

int ObjectRef::l_set_look_vertical ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and PlayerSAO::setLookPitchAndSend().

+ Here is the call graph for this function:

◆ l_set_look_yaw()

int ObjectRef::l_set_look_yaw ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getplayersao(), log_deprecated(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and PlayerSAO::setPlayerYawAndSend().

+ Here is the call graph for this function:

◆ l_set_minimap_modes()

int ObjectRef::l_set_minimap_modes ( lua_State * L)
staticprivate

◆ l_set_moon()

int ObjectRef::l_set_moon ( lua_State * L)
staticprivate

◆ l_set_nametag_attributes()

int ObjectRef::l_set_nametag_attributes ( lua_State * L)
staticprivate

◆ l_set_observers()

int ObjectRef::l_set_observers ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), GET_ENV_PTR, Player::getName(), getobject(), getplayer(), is_valid_player_name(), ServerActiveObject::m_observers, and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_set_physics_override()

int ObjectRef::l_set_physics_override ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getboolfield(), getfloatfield(), PlayerSAO::getPlayer(), getplayersao(), PlayerSAO::m_physics_override_sent, NO_MAP_LOCK_REQUIRED, and Player::physics_override.

+ Here is the call graph for this function:

◆ l_set_pos()

int ObjectRef::l_set_pos ( lua_State * L)
staticprivate

References checkFloatPos(), ModApiBase::checkObject(), getobject(), NO_MAP_LOCK_REQUIRED, and ServerActiveObject::setPos().

+ Here is the call graph for this function:

◆ l_set_properties()

int ObjectRef::l_set_properties ( lua_State * L)
staticprivate

References ServerActiveObject::accessObjectProperties(), ModApiBase::checkObject(), getobject(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, ServerActiveObject::notifyObjectPropertiesModified(), and read_object_properties().

+ Here is the call graph for this function:

◆ l_set_rotation()

int ObjectRef::l_set_rotation ( lua_State * L)
staticprivate

References check_v3f(), ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, and UnitSAO::setRotation().

+ Here is the call graph for this function:

◆ l_set_sky()

◆ l_set_sprite()

int ObjectRef::l_set_sprite ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and LuaEntitySAO::setSprite().

+ Here is the call graph for this function:

◆ l_set_stars()

int ObjectRef::l_set_stars ( lua_State * L)
staticprivate

◆ l_set_sun()

int ObjectRef::l_set_sun ( lua_State * L)
staticprivate

◆ l_set_texture_mod()

int ObjectRef::l_set_texture_mod ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and LuaEntitySAO::setTextureMod().

+ Here is the call graph for this function:

◆ l_set_velocity()

int ObjectRef::l_set_velocity ( lua_State * L)
staticprivate

References checkFloatPos(), ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, and LuaEntitySAO::setVelocity().

+ Here is the call graph for this function:

◆ l_set_wielded_item()

int ObjectRef::l_set_wielded_item ( lua_State * L)
staticprivate

References ACTIVEOBJECT_TYPE_PLAYER, ModApiBase::checkObject(), getobject(), ModApiBase::getServer(), ActiveObject::getType(), NO_MAP_LOCK_REQUIRED, read_item(), Server::SendInventory(), and ServerActiveObject::setWieldedItem().

+ Here is the call graph for this function:

◆ l_set_yaw()

int ObjectRef::l_set_yaw ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), getluaobject(), NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and UnitSAO::setRotation().

+ Here is the call graph for this function:

◆ Register()

void ObjectRef::Register ( lua_State * L)
static

References className, gc_object(), methods, and ModApiBase::registerClass().

Referenced by ServerScripting::InitializeModApi().

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

◆ set_null()

void ObjectRef::set_null ( lua_State * L,
void * expect )
static

References ModApiBase::checkObject(), FATAL_ERROR_IF, and m_object.

Referenced by ScriptApiBase::removeObjectReference().

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

Member Data Documentation

◆ className

const char ObjectRef::className = "ObjectRef"
static

Referenced by create(), and Register().

◆ m_object

ServerActiveObject* ObjectRef::m_object = nullptr
private

Referenced by getobject(), and set_null().

◆ methods

luaL_Reg ObjectRef::methods
staticprivate

Referenced by Register().


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