diff options
author | red-001 <red-001@outlook.ie> | 2017-04-04 06:41:37 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-04 07:41:37 +0200 |
commit | 000ec260017256016b62bb9936bbda1ff969e252 (patch) | |
tree | 9eebd6b3f1be915fe1195e241a8a754f1bb44259 /src/script/lua_api/l_nodemeta.h | |
parent | 859141a0ce38fbd606d95ae7a2f0999acf2fbe84 (diff) | |
download | minetest-000ec260017256016b62bb9936bbda1ff969e252.tar.gz minetest-000ec260017256016b62bb9936bbda1ff969e252.tar.bz2 minetest-000ec260017256016b62bb9936bbda1ff969e252.zip |
[CSM] Add local node meta reference. (#5508)
Diffstat (limited to 'src/script/lua_api/l_nodemeta.h')
-rw-r--r-- | src/script/lua_api/l_nodemeta.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/script/lua_api/l_nodemeta.h b/src/script/lua_api/l_nodemeta.h index d03f086c9..6d146416b 100644 --- a/src/script/lua_api/l_nodemeta.h +++ b/src/script/lua_api/l_nodemeta.h @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "lua_api/l_base.h" #include "lua_api/l_metadata.h" #include "irrlichttypes_bloated.h" +#include "nodemetadata.h" class ServerEnvironment; class NodeMetadata; @@ -34,9 +35,12 @@ class NodeMetaRef : public MetaDataRef { private: v3s16 m_p; ServerEnvironment *m_env; + Metadata *m_meta; + bool m_is_local; static const char className[]; - static const luaL_reg methods[]; + static const luaL_reg methodsServer[]; + static const luaL_reg methodsClient[]; static NodeMetaRef *checkobject(lua_State *L, int narg); @@ -71,6 +75,7 @@ private: public: NodeMetaRef(v3s16 p, ServerEnvironment *env); + NodeMetaRef(Metadata *meta); ~NodeMetaRef(); @@ -78,7 +83,12 @@ public: // Not callable from Lua; all references are created on the C side. static void create(lua_State *L, v3s16 p, ServerEnvironment *env); + // Client-sided version of the above + static void createClient(lua_State *L, Metadata *meta); + + static void RegisterCommon(lua_State *L); static void Register(lua_State *L); + static void RegisterClient(lua_State *L); }; #endif /* L_NODEMETA_H_ */ |