Minetest  5.4.0
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)
 
static void Register (lua_State *L)
 
static ObjectRefcheckobject (lua_State *L, int narg)
 
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 ClientgetClient (lua_State *L)
 
static GUIEnginegetGuiEngine (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 int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions. More...
 

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_get_pos (lua_State *L)
 
static int l_set_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_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_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_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)
 

Private Attributes

ServerActiveObjectm_object = nullptr
 

Static Private Attributes

static const char className [] = "ObjectRef"
 
static luaL_Reg methods []
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
- Static Protected Member Functions inherited from LuaHelper
static bool isNaN (lua_State *L, int idx)
 
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua State L and index. More...
 
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 and index. More...
 

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

◆ checkobject()

ObjectRef * ObjectRef::checkobject ( lua_State *  L,
int  narg 
)
static

References className.

Referenced by ModApiParticles::l_add_particlespawner(), l_add_velocity(), l_get_acceleration(), l_get_animation(), l_get_armor_groups(), l_get_attach(), l_get_attribute(), l_get_bone_position(), l_get_breath(), l_get_children(), l_get_clouds(), l_get_day_night_ratio(), l_get_entity_name(), l_get_eye_offset(), l_get_formspec_prepend(), l_get_fov(), l_get_hp(), l_get_inventory(), l_get_inventory_formspec(), l_get_local_animation(), l_get_look_dir(), l_get_look_horizontal(), l_get_look_pitch(), l_get_look_vertical(), l_get_look_yaw(), l_get_luaentity(), l_get_meta(), l_get_moon(), l_get_nametag_attributes(), l_get_physics_override(), l_get_player_control(), l_get_player_control_bits(), l_get_player_name(), l_get_pos(), l_get_properties(), l_get_rotation(), l_get_sky(), l_get_sky_color(), l_get_stars(), l_get_sun(), l_get_texture_mod(), l_get_velocity(), l_get_wield_index(), l_get_wield_list(), l_get_wielded_item(), l_get_yaw(), l_hud_add(), l_hud_change(), l_hud_get(), l_hud_get_flags(), l_hud_get_hotbar_image(), l_hud_get_hotbar_itemcount(), l_hud_get_hotbar_selected_image(), l_hud_remove(), l_hud_set_flags(), l_hud_set_hotbar_image(), l_hud_set_hotbar_itemcount(), l_hud_set_hotbar_selected_image(), l_is_player(), l_move_to(), l_override_day_night_ratio(), l_punch(), l_remove(), l_right_click(), l_send_mapblock(), l_set_acceleration(), l_set_animation(), l_set_animation_frame_speed(), l_set_armor_groups(), l_set_attach(), l_set_attribute(), l_set_bone_position(), l_set_breath(), l_set_clouds(), l_set_detach(), l_set_eye_offset(), l_set_formspec_prepend(), l_set_fov(), l_set_hp(), l_set_inventory_formspec(), l_set_local_animation(), l_set_look_horizontal(), l_set_look_pitch(), l_set_look_vertical(), l_set_look_yaw(), l_set_minimap_modes(), l_set_moon(), l_set_nametag_attributes(), l_set_physics_override(), l_set_pos(), l_set_properties(), l_set_rotation(), l_set_sky(), l_set_sprite(), l_set_stars(), l_set_sun(), l_set_texture_mod(), l_set_velocity(), l_set_wielded_item(), l_set_yaw(), read_server_sound_params(), and set_null().

◆ 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_look_dir(), l_get_look_horizontal(), l_get_look_pitch(), l_get_look_vertical(), l_get_look_yaw(), l_get_meta(), l_get_physics_override(), l_set_attribute(), l_set_breath(), 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_velocity()

int ObjectRef::l_add_velocity ( lua_State *  L)
staticprivate

References ACTIVEOBJECT_TYPE_LUAENTITY, ACTIVEOBJECT_TYPE_PLAYER, LuaEntitySAO::addVelocity(), checkFloatPos(), checkobject(), getobject(), PlayerSAO::getPeerID(), ModApiBase::getServer(), ActiveObject::getType(), NO_MAP_LOCK_REQUIRED, Server::SendPlayerSpeed(), and PlayerSAO::setMaxSpeedOverride().

+ Here is the call graph for this function:

◆ l_get_acceleration()

int ObjectRef::l_get_acceleration ( lua_State *  L)
staticprivate

References 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 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 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 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 checkobject(), PlayerSAO::getMeta(), getplayersao(), Metadata::getStringToRef(), and log_deprecated().

+ Here is the call graph for this function:

◆ l_get_bone_position()

int ObjectRef::l_get_bone_position ( lua_State *  L)
staticprivate

References checkobject(), ServerActiveObject::getBonePosition(), getobject(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_breath()

int ObjectRef::l_get_breath ( lua_State *  L)
staticprivate

References 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 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 checkobject(), CloudParams::color_ambient, CloudParams::color_bright, 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 checkobject(), RemotePlayer::getDayNightRatio(), getplayer(), 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 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 checkobject(), Player::eye_offset_first, Player::eye_offset_third, getplayer(), NO_MAP_LOCK_REQUIRED, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_formspec_prepend()

int ObjectRef::l_get_formspec_prepend ( lua_State *  L)
staticprivate

References 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 checkobject(), PlayerFovSpec::fov, Player::getFov(), getplayer(), PlayerFovSpec::is_multiplier, NO_MAP_LOCK_REQUIRED, and PlayerFovSpec::transition_time.

+ Here is the call graph for this function:

◆ l_get_hp()

int ObjectRef::l_get_hp ( lua_State *  L)
staticprivate

References 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 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 checkobject(), getplayer(), Player::inventory_formspec, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_local_animation()

int ObjectRef::l_get_local_animation ( lua_State *  L)
staticprivate

References checkobject(), RemotePlayer::getLocalAnimations(), getplayer(), NO_MAP_LOCK_REQUIRED, and push_v2s32().

+ Here is the call graph for this function:

◆ l_get_look_dir()

int ObjectRef::l_get_look_dir ( lua_State *  L)
staticprivate

References 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 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 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 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 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 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 checkobject(), PlayerMetaRef::create(), PlayerSAO::getMeta(), and getplayersao().

+ Here is the call graph for this function:

◆ l_get_moon()

int ObjectRef::l_get_moon ( lua_State *  L)
staticprivate

References 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(), checkobject(), getobject(), ObjectProperties::nametag, ObjectProperties::nametag_bgcolor, ObjectProperties::nametag_color, NO_MAP_LOCK_REQUIRED, push_ARGB8(), and Optional< T >::value().

+ Here is the call graph for this function:

◆ l_get_physics_override()

int ObjectRef::l_get_physics_override ( lua_State *  L)
staticprivate

◆ l_get_player_control()

int ObjectRef::l_get_player_control ( lua_State *  L)
staticprivate

References PlayerControl::aux1, checkobject(), PlayerControl::dig, PlayerControl::down, getplayer(), Player::getPlayerControl(), PlayerControl::jump, PlayerControl::left, NO_MAP_LOCK_REQUIRED, PlayerControl::place, PlayerControl::right, PlayerControl::sneak, PlayerControl::up, 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 checkobject(), getplayer(), Player::keyPressed, 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 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, 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(), 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 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

References SkyboxParams::bgcolor, checkobject(), SkyboxParams::clouds, getplayer(), RemotePlayer::getSkyParams(), NO_MAP_LOCK_REQUIRED, push_ARGB8(), SkyboxParams::textures, and SkyboxParams::type.

+ Here is the call graph for this function:

◆ l_get_sky_color()

int ObjectRef::l_get_sky_color ( lua_State *  L)
staticprivate

◆ l_get_stars()

int ObjectRef::l_get_stars ( lua_State *  L)
staticprivate

References checkobject(), StarParams::count, 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 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 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, 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 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 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 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 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 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 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 checkobject(), Player::getHud(), getplayer(), 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 checkobject(), getplayer(), HUD_FLAG_BREATHBAR_VISIBLE, HUD_FLAG_CROSSHAIR_VISIBLE, HUD_FLAG_HEALTHBAR_VISIBLE, HUD_FLAG_HOTBAR_VISIBLE, HUD_FLAG_MINIMAP_RADAR_VISIBLE, HUD_FLAG_MINIMAP_VISIBLE, HUD_FLAG_WIELDITEM_VISIBLE, Player::hud_flags, and NO_MAP_LOCK_REQUIRED.

+ 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 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 checkobject(), RemotePlayer::getHotbarItemcount(), 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 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 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 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 checkobject(), getplayer(), ModApiBase::getServer(), Server::hudSetHotbarImage(), and NO_MAP_LOCK_REQUIRED.

+ 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 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 checkobject(), getplayer(), ModApiBase::getServer(), Server::hudSetHotbarSelectedImage(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_is_player()

int ObjectRef::l_is_player ( lua_State *  L)
staticprivate

References checkobject(), getplayer(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_move_to()

int ObjectRef::l_move_to ( lua_State *  L)
staticprivate

References checkFloatPos(), checkobject(), getobject(), ServerActiveObject::moveTo(), and NO_MAP_LOCK_REQUIRED.

+ 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 checkobject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and Server::overrideDayNightRatio().

+ Here is the call graph for this function:

◆ l_punch()

int ObjectRef::l_punch ( lua_State *  L)
staticprivate

◆ l_remove()

int ObjectRef::l_remove ( lua_State *  L)
staticprivate

References ACTIVEOBJECT_TYPE_PLAYER, checkobject(), ActiveObject::clearChildAttachments(), ActiveObject::clearParentAttachment(), GET_ENV_PTR, ActiveObject::getId(), getobject(), ActiveObject::getType(), ServerActiveObject::markForRemoval(), and verbosestream.

+ Here is the call graph for this function:

◆ l_right_click()

int ObjectRef::l_right_click ( lua_State *  L)
staticprivate

References 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 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(), 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 checkobject(), getobject(), NO_MAP_LOCK_REQUIRED, 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 checkobject(), getobject(), NO_MAP_LOCK_REQUIRED, 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, 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 ActiveObject::addAttachmentChild(), checkobject(), GET_ENV_PTR, ActiveObject::getAttachment(), ActiveObject::getId(), getobject(), ActiveObject::removeAttachmentChild(), and ActiveObject::setAttachment().

+ Here is the call graph for this function:

◆ l_set_attribute()

int ObjectRef::l_set_attribute ( lua_State *  L)
staticprivate

References checkobject(), PlayerSAO::getMeta(), getplayersao(), log_deprecated(), Metadata::removeString(), and Metadata::setString().

+ Here is the call graph for this function:

◆ l_set_bone_position()

int ObjectRef::l_set_bone_position ( lua_State *  L)
staticprivate

References checkobject(), getobject(), NO_MAP_LOCK_REQUIRED, and ServerActiveObject::setBonePosition().

+ Here is the call graph for this function:

◆ l_set_breath()

int ObjectRef::l_set_breath ( lua_State *  L)
staticprivate

References 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 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 checkobject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, rangelim, and Server::setPlayerEyeOffset().

+ Here is the call graph for this function:

◆ l_set_formspec_prepend()

int ObjectRef::l_set_formspec_prepend ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_set_fov()

int ObjectRef::l_set_fov ( lua_State *  L)
staticprivate

References checkobject(), RemotePlayer::getPeerId(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, Server::SendPlayerFov(), and Player::setFov().

+ 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 checkobject(), Player::getName(), getplayer(), ModApiBase::getServer(), Player::inventory_formspec, NO_MAP_LOCK_REQUIRED, and Server::reportInventoryFormspecModified().

+ Here is the call graph for this function:

◆ l_set_local_animation()

int ObjectRef::l_set_local_animation ( lua_State *  L)
staticprivate

References checkobject(), getplayer(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_v2s32(), 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 checkobject(), getplayersao(), NO_MAP_LOCK_REQUIRED, 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 checkobject(), getplayersao(), log_deprecated(), NO_MAP_LOCK_REQUIRED, 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 checkobject(), getplayersao(), NO_MAP_LOCK_REQUIRED, 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 checkobject(), getplayersao(), log_deprecated(), NO_MAP_LOCK_REQUIRED, 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

References checkobject(), getboolfield_default(), getfloatfield_default(), RemotePlayer::getMoonParams(), getplayer(), ModApiBase::getServer(), getstringfield_default(), NO_MAP_LOCK_REQUIRED, MoonParams::scale, Server::setMoon(), MoonParams::texture, MoonParams::tonemap, and MoonParams::visible.

+ Here is the call graph for this function:

◆ l_set_nametag_attributes()

int ObjectRef::l_set_nametag_attributes ( lua_State *  L)
staticprivate

◆ l_set_physics_override()

int ObjectRef::l_set_physics_override ( lua_State *  L)
staticprivate

◆ l_set_pos()

int ObjectRef::l_set_pos ( lua_State *  L)
staticprivate

References checkFloatPos(), 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(), 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(), 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 checkobject(), getluaobject(), NO_MAP_LOCK_REQUIRED, and LuaEntitySAO::setSprite().

+ Here is the call graph for this function:

◆ l_set_stars()

int ObjectRef::l_set_stars ( lua_State *  L)
staticprivate

References checkobject(), StarParams::count, getboolfield_default(), getfloatfield_default(), getintfield_default(), getplayer(), ModApiBase::getServer(), RemotePlayer::getStarParams(), NO_MAP_LOCK_REQUIRED, read_color(), StarParams::scale, Server::setStars(), StarParams::starcolor, and StarParams::visible.

+ Here is the call graph for this function:

◆ 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 checkobject(), getluaobject(), NO_MAP_LOCK_REQUIRED, 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(), 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, 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 checkobject(), getluaobject(), NO_MAP_LOCK_REQUIRED, and UnitSAO::setRotation().

+ Here is the call graph for this function:

◆ Register()

void ObjectRef::Register ( lua_State *  L)
static

References className, gc_object(), and methods.

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)
static

References checkobject(), 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"
staticprivate

Referenced by checkobject(), 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: