aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_localplayer.cpp
Commit message (Expand)AuthorAge
* Attachments: Fix interpolation from (0,0,0) after detachSmallJoker2019-12-07
* Load CSM environment after the restrictions are knownSmallJoker2019-09-14
* Move client-specific files to 'src/client' (#7902)Quentin Bazin2018-11-28
* [CSM] Add basic HUD manipulation. (#6067)red-0012018-01-20
* Cleanup various headers to reduce compilation times (#6255)Loïc Blot2017-08-16
* C++11 cleanup on constructors (#6000)Vincent Glize2017-06-19
* [CSM] Add camera API (#5609)bigfoot5472017-05-05
* Sneak: Improve and fix various thingsSmallJoker2017-05-03
* Replace occurrence of luaL_reg in l_localplayer (#5566)t0ny22017-04-11
* Clang-format styles fixes since previous commitLoïc Blot2017-04-10
* Clang format: fix LINT on old PR which doesn't have LINT enabledLoic Blot2017-04-10
* LocalPlayer api luaVincent Glize2017-04-08
s="hl com">GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef L_NODEMETA_H_ #define L_NODEMETA_H_ #include "lua_api/l_base.h" #include "irrlichttypes_bloated.h" class ServerEnvironment; class NodeMetadata; /* NodeMetaRef */ class NodeMetaRef : public ModApiBase { private: v3s16 m_p; ServerEnvironment *m_env; static const char className[]; static const luaL_reg methods[]; static NodeMetaRef *checkobject(lua_State *L, int narg); /** * Retrieve metadata for a node. * If @p auto_create is set and the specified node has no metadata information * associated with it yet, the method attempts to attach a new metadata object * to the node and returns a pointer to the metadata when successful. * * However, it is NOT guaranteed that the method will return a pointer, * and @c NULL may be returned in case of an error regardless of @p auto_create. * * @param ref specifies the node for which the associated metadata is retrieved. * @param auto_create when true, try to create metadata information for the node if it has none. * @return pointer to a @c NodeMetadata object or @c NULL in case of error. */ static NodeMetadata* getmeta(NodeMetaRef *ref, bool auto_create); static void reportMetadataChange(NodeMetaRef *ref); // Exported functions // garbage collector static int gc_object(lua_State *L); // get_string(self, name) static int l_get_string(lua_State *L); // set_string(self, name, var) static int l_set_string(lua_State *L); // get_int(self, name) static int l_get_int(lua_State *L); // set_int(self, name, var) static int l_set_int(lua_State *L); // get_float(self, name) static int l_get_float(lua_State *L); // set_float(self, name, var) static int l_set_float(lua_State *L); // get_inventory(self) static int l_get_inventory(lua_State *L); // to_table(self) static int l_to_table(lua_State *L); // from_table(self, table) static int l_from_table(lua_State *L); public: NodeMetaRef(v3s16 p, ServerEnvironment *env); ~NodeMetaRef(); // Creates an NodeMetaRef and leaves it on top of stack // Not callable from Lua; all references are created on the C side. static void create(lua_State *L, v3s16 p, ServerEnvironment *env); static void Register(lua_State *L); }; #endif /* L_NODEMETA_H_ */