1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

CraftItem rework and Lua interface

This commit is contained in:
Kahrl 2011-11-29 17:15:18 +02:00 committed by Perttu Ahola
parent 1c19f959db
commit d6b30dd3a5
21 changed files with 2162 additions and 1250 deletions

View file

@ -29,6 +29,7 @@ class ServerEnvironment;
class ServerActiveObject;
typedef struct lua_State lua_State;
struct LuaEntityProperties;
struct PointedThing;
//class IGameDef;
void scriptapi_export(lua_State *L, Server *server);
@ -60,6 +61,18 @@ void scriptapi_environment_on_generated(lua_State *L, v3s16 minp, v3s16 maxp);
void scriptapi_on_newplayer(lua_State *L, ServerActiveObject *player);
bool scriptapi_on_respawnplayer(lua_State *L, ServerActiveObject *player);
/* craftitem */
void scriptapi_add_craftitem(lua_State *L, const char *name);
bool scriptapi_craftitem_on_drop(lua_State *L, const char *name,
ServerActiveObject *dropper, v3f pos,
bool &callback_exists);
bool scriptapi_craftitem_on_place_on_ground(lua_State *L, const char *name,
ServerActiveObject *placer, v3f pos,
bool &callback_exists);
bool scriptapi_craftitem_on_use(lua_State *L, const char *name,
ServerActiveObject *user, const PointedThing& pointed,
bool &callback_exists);
/* luaentity */
// Returns true if succesfully added into Lua; false otherwise.
bool scriptapi_luaentity_add(lua_State *L, u16 id, const char *name,