mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Rename ObjectRef methods to be consistent and predictable
This commit is contained in:
parent
f3bd4c405d
commit
63c892eedf
4 changed files with 67 additions and 66 deletions
|
@ -150,9 +150,9 @@ int ObjectRef::l_remove(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// getpos(self)
|
||||
// get_pos(self)
|
||||
// returns: {x=num, y=num, z=num}
|
||||
int ObjectRef::l_getpos(lua_State *L)
|
||||
int ObjectRef::l_get_pos(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -169,8 +169,8 @@ int ObjectRef::l_getpos(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// setpos(self, pos)
|
||||
int ObjectRef::l_setpos(lua_State *L)
|
||||
// set_pos(self, pos)
|
||||
int ObjectRef::l_set_pos(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -184,8 +184,8 @@ int ObjectRef::l_setpos(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// moveto(self, pos, continuous=false)
|
||||
int ObjectRef::l_moveto(lua_State *L)
|
||||
// move_to(self, pos, continuous=false)
|
||||
int ObjectRef::l_move_to(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -821,8 +821,8 @@ int ObjectRef::l_get_nametag_attributes(lua_State *L)
|
|||
|
||||
/* LuaEntitySAO-only */
|
||||
|
||||
// setvelocity(self, {x=num, y=num, z=num})
|
||||
int ObjectRef::l_setvelocity(lua_State *L)
|
||||
// set_velocity(self, {x=num, y=num, z=num})
|
||||
int ObjectRef::l_set_velocity(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -834,8 +834,8 @@ int ObjectRef::l_setvelocity(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// getvelocity(self)
|
||||
int ObjectRef::l_getvelocity(lua_State *L)
|
||||
// get_velocity(self)
|
||||
int ObjectRef::l_get_velocity(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -847,8 +847,8 @@ int ObjectRef::l_getvelocity(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// setacceleration(self, {x=num, y=num, z=num})
|
||||
int ObjectRef::l_setacceleration(lua_State *L)
|
||||
// set_acceleration(self, {x=num, y=num, z=num})
|
||||
int ObjectRef::l_set_acceleration(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -861,8 +861,8 @@ int ObjectRef::l_setacceleration(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// getacceleration(self)
|
||||
int ObjectRef::l_getacceleration(lua_State *L)
|
||||
// get_acceleration(self)
|
||||
int ObjectRef::l_get_acceleration(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -874,8 +874,8 @@ int ObjectRef::l_getacceleration(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// setyaw(self, radians)
|
||||
int ObjectRef::l_setyaw(lua_State *L)
|
||||
// set_yaw(self, radians)
|
||||
int ObjectRef::l_set_yaw(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -887,8 +887,8 @@ int ObjectRef::l_setyaw(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// getyaw(self)
|
||||
int ObjectRef::l_getyaw(lua_State *L)
|
||||
// get_yaw(self)
|
||||
int ObjectRef::l_get_yaw(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -900,8 +900,8 @@ int ObjectRef::l_getyaw(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// settexturemod(self, mod)
|
||||
int ObjectRef::l_settexturemod(lua_State *L)
|
||||
// set_texture_mod(self, mod)
|
||||
int ObjectRef::l_set_texture_mod(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -913,9 +913,9 @@ int ObjectRef::l_settexturemod(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// setsprite(self, p={x=0,y=0}, num_frames=1, framelength=0.2,
|
||||
// set_sprite(self, p={x=0,y=0}, num_frames=1, framelength=0.2,
|
||||
// select_horiz_by_yawpitch=false)
|
||||
int ObjectRef::l_setsprite(lua_State *L)
|
||||
int ObjectRef::l_set_sprite(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
ObjectRef *ref = checkobject(L, 1);
|
||||
|
@ -1774,9 +1774,9 @@ const char ObjectRef::className[] = "ObjectRef";
|
|||
const luaL_reg ObjectRef::methods[] = {
|
||||
// ServerActiveObject
|
||||
luamethod(ObjectRef, remove),
|
||||
luamethod(ObjectRef, getpos),
|
||||
luamethod(ObjectRef, setpos),
|
||||
luamethod(ObjectRef, moveto),
|
||||
luamethod_aliased(ObjectRef, get_pos, getpos),
|
||||
luamethod_aliased(ObjectRef, set_pos, setpos),
|
||||
luamethod_aliased(ObjectRef, move_to, moveto),
|
||||
luamethod(ObjectRef, punch),
|
||||
luamethod(ObjectRef, right_click),
|
||||
luamethod(ObjectRef, set_hp),
|
||||
|
@ -1800,14 +1800,14 @@ const luaL_reg ObjectRef::methods[] = {
|
|||
luamethod(ObjectRef, set_nametag_attributes),
|
||||
luamethod(ObjectRef, get_nametag_attributes),
|
||||
// LuaEntitySAO-only
|
||||
luamethod(ObjectRef, setvelocity),
|
||||
luamethod(ObjectRef, getvelocity),
|
||||
luamethod(ObjectRef, setacceleration),
|
||||
luamethod(ObjectRef, getacceleration),
|
||||
luamethod(ObjectRef, setyaw),
|
||||
luamethod(ObjectRef, getyaw),
|
||||
luamethod(ObjectRef, settexturemod),
|
||||
luamethod(ObjectRef, setsprite),
|
||||
luamethod_aliased(ObjectRef, set_velocity, setvelocity),
|
||||
luamethod_aliased(ObjectRef, get_velocity, getvelocity),
|
||||
luamethod_aliased(ObjectRef, set_acceleration, setacceleration),
|
||||
luamethod_aliased(ObjectRef, get_acceleration, getacceleration),
|
||||
luamethod_aliased(ObjectRef, set_yaw, setyaw),
|
||||
luamethod_aliased(ObjectRef, get_yaw, getyaw),
|
||||
luamethod_aliased(ObjectRef, set_texture_mod, set_texturemod),
|
||||
luamethod_aliased(ObjectRef, set_sprite, setsprite),
|
||||
luamethod(ObjectRef, get_entity_name),
|
||||
luamethod(ObjectRef, get_luaentity),
|
||||
// Player-only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue