Minetest  5.4.0
LuaLocalPlayer Class Reference

#include <l_localplayer.h>

+ Inheritance diagram for LuaLocalPlayer:
+ Collaboration diagram for LuaLocalPlayer:

Public Member Functions

 LuaLocalPlayer (LocalPlayer *m)
 
 ~LuaLocalPlayer ()=default
 

Static Public Member Functions

static void create (lua_State *L, LocalPlayer *m)
 
static LuaLocalPlayercheckobject (lua_State *L, int narg)
 
static LocalPlayergetobject (LuaLocalPlayer *ref)
 
static LocalPlayergetobject (lua_State *L, int narg)
 
static void Register (lua_State *L)
 
- 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 int gc_object (lua_State *L)
 
static int l_get_velocity (lua_State *L)
 
static int l_get_hp (lua_State *L)
 
static int l_get_name (lua_State *L)
 
static int l_get_wield_index (lua_State *L)
 
static int l_get_wielded_item (lua_State *L)
 
static int l_is_attached (lua_State *L)
 
static int l_is_touching_ground (lua_State *L)
 
static int l_is_in_liquid (lua_State *L)
 
static int l_is_in_liquid_stable (lua_State *L)
 
static int l_get_liquid_viscosity (lua_State *L)
 
static int l_is_climbing (lua_State *L)
 
static int l_swimming_vertical (lua_State *L)
 
static int l_get_physics_override (lua_State *L)
 
static int l_get_override_pos (lua_State *L)
 
static int l_get_last_pos (lua_State *L)
 
static int l_get_last_velocity (lua_State *L)
 
static int l_get_last_look_vertical (lua_State *L)
 
static int l_get_last_look_horizontal (lua_State *L)
 
static int l_get_control (lua_State *L)
 
static int l_get_breath (lua_State *L)
 
static int l_get_pos (lua_State *L)
 
static int l_get_movement_acceleration (lua_State *L)
 
static int l_get_movement_speed (lua_State *L)
 
static int l_get_movement (lua_State *L)
 
static int l_get_armor_groups (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 int l_hud_get (lua_State *L)
 

Private Attributes

LocalPlayerm_localplayer = nullptr
 

Static Private Attributes

static const char className [] = "LocalPlayer"
 
static const 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

◆ LuaLocalPlayer()

LuaLocalPlayer::LuaLocalPlayer ( LocalPlayer m)

Referenced by create().

+ Here is the caller graph for this function:

◆ ~LuaLocalPlayer()

LuaLocalPlayer::~LuaLocalPlayer ( )
default

Member Function Documentation

◆ checkobject()

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

References className.

Referenced by getobject().

+ Here is the caller graph for this function:

◆ create()

void LuaLocalPlayer::create ( lua_State *  L,
LocalPlayer m 
)
static

References LuaLocalPlayer(), and className.

Referenced by ClientScripting::on_client_ready().

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

◆ gc_object()

int LuaLocalPlayer::gc_object ( lua_State *  L)
staticprivate

Referenced by Register().

+ Here is the caller graph for this function:

◆ getobject() [1/2]

LocalPlayer * LuaLocalPlayer::getobject ( lua_State *  L,
int  narg 
)
static

References checkobject(), and getobject().

+ Here is the call graph for this function:

◆ getobject() [2/2]

◆ l_get_armor_groups()

int LuaLocalPlayer::l_get_armor_groups ( lua_State *  L)
staticprivate

References LocalPlayer::getCAO(), GenericCAO::getGroups(), getobject(), and push_groups().

+ Here is the call graph for this function:

◆ l_get_breath()

int LuaLocalPlayer::l_get_breath ( lua_State *  L)
staticprivate

References LocalPlayer::getBreath(), and getobject().

+ Here is the call graph for this function:

◆ l_get_control()

int LuaLocalPlayer::l_get_control ( lua_State *  L)
staticprivate

References PlayerControl::aux1, PlayerControl::dig, PlayerControl::down, getobject(), Player::getPlayerControl(), PlayerControl::jump, PlayerControl::left, PlayerControl::place, PlayerControl::right, PlayerControl::sneak, PlayerControl::up, and PlayerControl::zoom.

+ Here is the call graph for this function:

◆ l_get_hp()

int LuaLocalPlayer::l_get_hp ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::hp.

+ Here is the call graph for this function:

◆ l_get_last_look_horizontal()

int LuaLocalPlayer::l_get_last_look_horizontal ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::last_yaw.

+ Here is the call graph for this function:

◆ l_get_last_look_vertical()

int LuaLocalPlayer::l_get_last_look_vertical ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::last_pitch.

+ Here is the call graph for this function:

◆ l_get_last_pos()

int LuaLocalPlayer::l_get_last_pos ( lua_State *  L)
staticprivate

References BS, getobject(), LocalPlayer::last_position, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_last_velocity()

int LuaLocalPlayer::l_get_last_velocity ( lua_State *  L)
staticprivate

References getobject(), LocalPlayer::last_speed, and push_v3f().

+ Here is the call graph for this function:

◆ l_get_liquid_viscosity()

int LuaLocalPlayer::l_get_liquid_viscosity ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::liquid_viscosity.

+ Here is the call graph for this function:

◆ l_get_movement()

int LuaLocalPlayer::l_get_movement ( lua_State *  L)
staticprivate

References getobject(), Player::movement_gravity, Player::movement_liquid_fluidity, Player::movement_liquid_fluidity_smooth, and Player::movement_liquid_sink.

+ Here is the call graph for this function:

◆ l_get_movement_acceleration()

int LuaLocalPlayer::l_get_movement_acceleration ( lua_State *  L)
staticprivate

References getobject(), Player::movement_acceleration_air, Player::movement_acceleration_default, and Player::movement_acceleration_fast.

+ Here is the call graph for this function:

◆ l_get_movement_speed()

int LuaLocalPlayer::l_get_movement_speed ( lua_State *  L)
staticprivate

References getobject(), Player::movement_speed_climb, Player::movement_speed_crouch, Player::movement_speed_fast, Player::movement_speed_jump, and Player::movement_speed_walk.

+ Here is the call graph for this function:

◆ l_get_name()

int LuaLocalPlayer::l_get_name ( lua_State *  L)
staticprivate

References Player::getName(), and getobject().

+ Here is the call graph for this function:

◆ l_get_override_pos()

static int LuaLocalPlayer::l_get_override_pos ( lua_State *  L)
staticprivate

◆ l_get_physics_override()

int LuaLocalPlayer::l_get_physics_override ( lua_State *  L)
staticprivate

References getobject(), LocalPlayer::physics_override_gravity, LocalPlayer::physics_override_jump, LocalPlayer::physics_override_new_move, LocalPlayer::physics_override_sneak, LocalPlayer::physics_override_sneak_glitch, and LocalPlayer::physics_override_speed.

+ Here is the call graph for this function:

◆ l_get_pos()

int LuaLocalPlayer::l_get_pos ( lua_State *  L)
staticprivate

References BS, getobject(), LocalPlayer::getPosition(), and push_v3f().

+ Here is the call graph for this function:

◆ l_get_velocity()

int LuaLocalPlayer::l_get_velocity ( lua_State *  L)
staticprivate

References BS, getobject(), Player::getSpeed(), and push_v3f().

+ Here is the call graph for this function:

◆ l_get_wield_index()

int LuaLocalPlayer::l_get_wield_index ( lua_State *  L)
staticprivate

References getobject(), and Player::getWieldIndex().

+ Here is the call graph for this function:

◆ l_get_wielded_item()

int LuaLocalPlayer::l_get_wielded_item ( lua_State *  L)
staticprivate

References LuaItemStack::create(), getobject(), and Player::getWieldedItem().

+ Here is the call graph for this function:

◆ l_hud_add()

int LuaLocalPlayer::l_hud_add ( lua_State *  L)
staticprivate

References Player::addHud(), getobject(), read_hud_element(), and U32_MAX.

+ Here is the call graph for this function:

◆ l_hud_change()

int LuaLocalPlayer::l_hud_change ( lua_State *  L)
staticprivate

References Player::getHud(), getobject(), and read_hud_change().

+ Here is the call graph for this function:

◆ l_hud_get()

int LuaLocalPlayer::l_hud_get ( lua_State *  L)
staticprivate

References Player::getHud(), getobject(), and push_hud_element().

+ Here is the call graph for this function:

◆ l_hud_remove()

int LuaLocalPlayer::l_hud_remove ( lua_State *  L)
staticprivate

References getobject(), and Player::removeHud().

+ Here is the call graph for this function:

◆ l_is_attached()

int LuaLocalPlayer::l_is_attached ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::getParent().

+ Here is the call graph for this function:

◆ l_is_climbing()

int LuaLocalPlayer::l_is_climbing ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::is_climbing.

+ Here is the call graph for this function:

◆ l_is_in_liquid()

int LuaLocalPlayer::l_is_in_liquid ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::in_liquid.

+ Here is the call graph for this function:

◆ l_is_in_liquid_stable()

int LuaLocalPlayer::l_is_in_liquid_stable ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::in_liquid_stable.

+ Here is the call graph for this function:

◆ l_is_touching_ground()

int LuaLocalPlayer::l_is_touching_ground ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::touching_ground.

+ Here is the call graph for this function:

◆ l_swimming_vertical()

int LuaLocalPlayer::l_swimming_vertical ( lua_State *  L)
staticprivate

References getobject(), and LocalPlayer::swimming_vertical.

+ Here is the call graph for this function:

◆ Register()

void LuaLocalPlayer::Register ( lua_State *  L)
static

References className, gc_object(), and methods.

Referenced by ClientScripting::InitializeModApi().

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

Member Data Documentation

◆ className

const char LuaLocalPlayer::className = "LocalPlayer"
staticprivate

Referenced by checkobject(), create(), and Register().

◆ m_localplayer

LocalPlayer* LuaLocalPlayer::m_localplayer = nullptr
private

Referenced by getobject().

◆ methods

const luaL_Reg LuaLocalPlayer::methods
staticprivate

Referenced by Register().


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