Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp
index f72a81d32..ba9f08700 100644
--- a/src/script/lua_api/l_object.cpp
+++ b/src/script/lua_api/l_object.cpp
@@ -561,6 +561,26 @@ int ObjectRef::l_get_eye_offset(lua_State *L)
return 2;
}
+// send_block(pos)
+int ObjectRef::l_send_block(lua_State *L)
+{
+ ObjectRef *ref = checkobject(L, 1);
+ RemotePlayer *player = getplayer(ref);
+ if (player == NULL)
+ return 0;
+ // Do it
+ v3f pos = v3f(0, 0, 0);
+ if (!lua_isnil(L, 2))
+ pos = read_v3f(L, 2);
+ elsee
+ return 0;
+
+ getServer(L)->send_mapblocks(player, pos); //????
+
+ lua_pushboolean(L, true);
+ return 1;
+}
+
// set_animation_frame_speed(self, frame_speed)
int ObjectRef::l_set_animation_frame_speed(lua_State *L)
{
@@ -1843,5 +1863,6 @@ const luaL_Reg ObjectRef::methods[] = {
luamethod(ObjectRef, get_local_animation),
luamethod(ObjectRef, set_eye_offset),
luamethod(ObjectRef, get_eye_offset),
+ luamethod(ObjectRef, send_block),
{0,0}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.