#### Methods
* `remove()`: remove object (after returning from Lua)
* Note: Doesn't work on players, use minetest.kick_player instead
-* `getpos()`: returns `{x=num, y=num, z=num}`
-* `setpos(pos)`; `pos`=`{x=num, y=num, z=num}`
-* `moveto(pos, continuous=false)`: interpolated move
+* `get_pos()`: returns `{x=num, y=num, z=num}`
+* `set_pos(pos)`; `pos`=`{x=num, y=num, z=num}`
+* `move_to(pos, continuous=false)`: interpolated move
* `punch(puncher, time_from_last_punch, tool_capabilities, direction)`
* `puncher` = another `ObjectRef`,
* `time_from_last_punch` = time since last punch action of the puncher
}
##### LuaEntitySAO-only (no-op for other objects)
-* `setvelocity({x=num, y=num, z=num})`
-* `getvelocity()`: returns `{x=num, y=num, z=num}`
-* `setacceleration({x=num, y=num, z=num})`
-* `getacceleration()`: returns `{x=num, y=num, z=num}`
-* `setyaw(radians)`
-* `getyaw()`: returns number in radians
-* `settexturemod(mod)`
-* `setsprite(p={x=0,y=0}, num_frames=1, framelength=0.2,
+* `set_velocity({x=num, y=num, z=num})`
+* `get_velocity()`: returns `{x=num, y=num, z=num}`
+* `set_acceleration({x=num, y=num, z=num})`
+* `get_acceleration()`: returns `{x=num, y=num, z=num}`
+* `set_yaw(radians)`
+* `get_yaw()`: returns number in radians
+* `set_texture_mod(mod)`
+* `set_sprite(p={x=0,y=0}, num_frames=1, framelength=0.2,
select_horiz_by_yawpitch=false)`
* Select sprite from spritesheet with optional animation and DM-style
texture selection based on yaw relative to camera
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);
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);
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);
/* 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);
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);
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);
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);
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);
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);
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);
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);
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),
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
// remove(self)
static int l_remove(lua_State *L);
- // getpos(self)
+ // get_pos(self)
// returns: {x=num, y=num, z=num}
- static int l_getpos(lua_State *L);
+ static int l_get_pos(lua_State *L);
- // setpos(self, pos)
- static int l_setpos(lua_State *L);
+ // set_pos(self, pos)
+ static int l_set_pos(lua_State *L);
- // moveto(self, pos, continuous=false)
- static int l_moveto(lua_State *L);
+ // move_to(self, pos, continuous=false)
+ static int l_move_to(lua_State *L);
// punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
static int l_punch(lua_State *L);
/* LuaEntitySAO-only */
- // setvelocity(self, {x=num, y=num, z=num})
- static int l_setvelocity(lua_State *L);
+ // set_velocity(self, {x=num, y=num, z=num})
+ static int l_set_velocity(lua_State *L);
- // getvelocity(self)
- static int l_getvelocity(lua_State *L);
+ // get_velocity(self)
+ static int l_get_velocity(lua_State *L);
- // setacceleration(self, {x=num, y=num, z=num})
- static int l_setacceleration(lua_State *L);
+ // set_acceleration(self, {x=num, y=num, z=num})
+ static int l_set_acceleration(lua_State *L);
- // getacceleration(self)
- static int l_getacceleration(lua_State *L);
+ // get_acceleration(self)
+ static int l_get_acceleration(lua_State *L);
- // setyaw(self, radians)
- static int l_setyaw(lua_State *L);
+ // set_yaw(self, radians)
+ static int l_set_yaw(lua_State *L);
- // getyaw(self)
- static int l_getyaw(lua_State *L);
+ // get_yaw(self)
+ static int l_get_yaw(lua_State *L);
- // settexturemod(self, mod)
- static int l_settexturemod(lua_State *L);
+ // set_texture_mod(self, mod)
+ static int l_set_texture_mod(lua_State *L);
- // 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)
- static int l_setsprite(lua_State *L);
+ static int l_set_sprite(lua_State *L);
// DEPRECATED
// get_entity_name(self)