]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/lua_api/l_object.h
Implement adding velocity to player from Lua
[dragonfireclient.git] / src / script / lua_api / l_object.h
index a2438e4345ffe6ad51d857073acdd30bc242b738..2390c51958371eaceb9ae7e3074a73dc20dd40f2 100644 (file)
@@ -35,7 +35,7 @@ class ObjectRef : public ModApiBase {
 public:
        ObjectRef(ServerActiveObject *object);
 
-       ~ObjectRef();
+       ~ObjectRef() = default;
 
        // Creates an ObjectRef and leaves it on top of stack
        // Not callable from Lua; all references are created on the C side.
@@ -50,9 +50,8 @@ class ObjectRef : public ModApiBase {
        static ServerActiveObject* getobject(ObjectRef *ref);
 private:
        ServerActiveObject *m_object = nullptr;
-
        static const char className[];
-       static const luaL_Reg methods[];
+       static luaL_Reg methods[];
 
 
        static LuaEntitySAO* getluaobject(ObjectRef *ref);
@@ -126,6 +125,9 @@ class ObjectRef : public ModApiBase {
        // set_animation(self, frame_range, frame_speed, frame_blend, frame_loop)
        static int l_set_animation(lua_State *L);
 
+       // set_animation_frame_speed(self, frame_speed)
+       static int l_set_animation_frame_speed(lua_State *L);
+
        // get_animation(self)
        static int l_get_animation(lua_State *L);
 
@@ -158,6 +160,9 @@ class ObjectRef : public ModApiBase {
        // set_velocity(self, {x=num, y=num, z=num})
        static int l_set_velocity(lua_State *L);
 
+       // add_velocity(self, {x=num, y=num, z=num})
+       static int l_add_velocity(lua_State *L);
+
        // get_velocity(self)
        static int l_get_velocity(lua_State *L);
 
@@ -167,6 +172,12 @@ class ObjectRef : public ModApiBase {
        // get_acceleration(self)
        static int l_get_acceleration(lua_State *L);
 
+       // set_rotation(self, {x=num, y=num, z=num})
+       static int l_set_rotation(lua_State *L);
+
+       // get_rotation(self)
+       static int l_get_rotation(lua_State *L);
+
        // set_yaw(self, radians)
        static int l_set_yaw(lua_State *L);
 
@@ -201,6 +212,9 @@ class ObjectRef : public ModApiBase {
        // get_player_velocity(self)
        static int l_get_player_velocity(lua_State *L);
 
+       // add_player_velocity(self, {x=num, y=num, z=num})
+       static int l_add_player_velocity(lua_State *L);
+
        // get_look_dir(self)
        static int l_get_look_dir(lua_State *L);
 
@@ -244,12 +258,21 @@ class ObjectRef : public ModApiBase {
        // get_attribute(self, attribute)
        static int l_get_attribute(lua_State *L);
 
+       // get_meta(self)
+       static int l_get_meta(lua_State *L);
+
        // set_inventory_formspec(self, formspec)
        static int l_set_inventory_formspec(lua_State *L);
 
        // get_inventory_formspec(self) -> formspec
        static int l_get_inventory_formspec(lua_State *L);
 
+       // set_formspec_prepend(self, formspec)
+       static int l_set_formspec_prepend(lua_State *L);
+
+       // get_formspec_prepend(self) -> formspec
+       static int l_get_formspec_prepend(lua_State *L);
+
        // get_player_control(self)
        static int l_get_player_control(lua_State *L);
 
@@ -331,4 +354,6 @@ class ObjectRef : public ModApiBase {
        // get_nametag_attributes(self)
        static int l_get_nametag_attributes(lua_State *L);
 
+       // send_mapblock(pos)
+       static int l_send_mapblock(lua_State *L);
 };