From 082573771f469cfaef03d22e4281f207beef36c8 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 14 Nov 2013 15:37:09 +0100 Subject: Added cSignEntity into API, added cChunkDesc:GetBlockEntity(). This fixes both #228 and #347. --- source/Bindings.cpp | 340 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 314 insertions(+), 26 deletions(-) (limited to 'source/Bindings.cpp') diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 236802d4e..6ae121f19 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 11/14/13 16:18:41. +** Generated automatically by tolua++-1.0.92 on 11/14/13 15:31:51. */ #ifndef __cplusplus @@ -46,6 +46,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S); #include "BlockEntities/DropperEntity.h" #include "BlockEntities/FurnaceEntity.h" #include "BlockEntities/HopperEntity.h" +#include "BlockEntities/SignEntity.h" #include "WebAdmin.h" #include "WebPlugin.h" #include "Root.h" @@ -74,9 +75,9 @@ static int tolua_collect_cItem (lua_State* tolua_S) return 0; } -static int tolua_collect_Vector3f (lua_State* tolua_S) +static int tolua_collect_cFurnaceEntity (lua_State* tolua_S) { - Vector3f* self = (Vector3f*) tolua_tousertype(tolua_S,1,0); + cFurnaceEntity* self = (cFurnaceEntity*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } @@ -130,30 +131,30 @@ static int tolua_collect_cLuaWindow (lua_State* tolua_S) return 0; } -static int tolua_collect_cDropperEntity (lua_State* tolua_S) +static int tolua_collect_cCraftingGrid (lua_State* tolua_S) { - cDropperEntity* self = (cDropperEntity*) tolua_tousertype(tolua_S,1,0); + cCraftingGrid* self = (cCraftingGrid*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } -static int tolua_collect_cPickup (lua_State* tolua_S) +static int tolua_collect_cDropperEntity (lua_State* tolua_S) { - cPickup* self = (cPickup*) tolua_tousertype(tolua_S,1,0); + cDropperEntity* self = (cDropperEntity*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } -static int tolua_collect_cItems (lua_State* tolua_S) +static int tolua_collect_cPickup (lua_State* tolua_S) { - cItems* self = (cItems*) tolua_tousertype(tolua_S,1,0); + cPickup* self = (cPickup*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } -static int tolua_collect_cCraftingGrid (lua_State* tolua_S) +static int tolua_collect_sWebAdminPage (lua_State* tolua_S) { - cCraftingGrid* self = (cCraftingGrid*) tolua_tousertype(tolua_S,1,0); + sWebAdminPage* self = (sWebAdminPage*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } @@ -172,16 +173,23 @@ static int tolua_collect_cBoundingBox (lua_State* tolua_S) return 0; } -static int tolua_collect_sWebAdminPage (lua_State* tolua_S) +static int tolua_collect_cHopperEntity (lua_State* tolua_S) { - sWebAdminPage* self = (sWebAdminPage*) tolua_tousertype(tolua_S,1,0); + cHopperEntity* self = (cHopperEntity*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } -static int tolua_collect_cHopperEntity (lua_State* tolua_S) +static int tolua_collect_Vector3f (lua_State* tolua_S) { - cHopperEntity* self = (cHopperEntity*) tolua_tousertype(tolua_S,1,0); + Vector3f* self = (Vector3f*) tolua_tousertype(tolua_S,1,0); + Mtolua_delete(self); + return 0; +} + +static int tolua_collect_cIniFile (lua_State* tolua_S) +{ + cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } @@ -193,16 +201,16 @@ static int tolua_collect_Vector3i (lua_State* tolua_S) return 0; } -static int tolua_collect_cFurnaceEntity (lua_State* tolua_S) +static int tolua_collect_cItems (lua_State* tolua_S) { - cFurnaceEntity* self = (cFurnaceEntity*) tolua_tousertype(tolua_S,1,0); + cItems* self = (cItems*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } -static int tolua_collect_cIniFile (lua_State* tolua_S) +static int tolua_collect_cSignEntity (lua_State* tolua_S) { - cIniFile* self = (cIniFile*) tolua_tousertype(tolua_S,1,0); + cSignEntity* self = (cSignEntity*) tolua_tousertype(tolua_S,1,0); Mtolua_delete(self); return 0; } @@ -254,21 +262,22 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cHopperEntity"); tolua_usertype(tolua_S,"std::vector"); tolua_usertype(tolua_S,"cBlockEntityWithItems"); + tolua_usertype(tolua_S,"cWindow"); tolua_usertype(tolua_S,"HTTPFormData"); - tolua_usertype(tolua_S,"cTracer"); + tolua_usertype(tolua_S,"cGroup"); tolua_usertype(tolua_S,"cArrowEntity"); tolua_usertype(tolua_S,"cDropSpenserEntity"); - tolua_usertype(tolua_S,"cWindow"); - tolua_usertype(tolua_S,"cBlockArea"); tolua_usertype(tolua_S,"cCraftingGrid"); - tolua_usertype(tolua_S,"cPlayer"); - tolua_usertype(tolua_S,"cGroup"); + tolua_usertype(tolua_S,"HTTPRequest"); + tolua_usertype(tolua_S,"cBlockArea"); + tolua_usertype(tolua_S,"cTracer"); + tolua_usertype(tolua_S,"cBoundingBox"); tolua_usertype(tolua_S,"cBlockEntity"); tolua_usertype(tolua_S,"cCriticalSection"); tolua_usertype(tolua_S,"HTTPTemplateRequest"); tolua_usertype(tolua_S,"cServer"); - tolua_usertype(tolua_S,"cBoundingBox"); tolua_usertype(tolua_S,"Vector3i"); + tolua_usertype(tolua_S,"cPlayer"); tolua_usertype(tolua_S,"cFile"); tolua_usertype(tolua_S,"cItems"); tolua_usertype(tolua_S,"cClientHandle"); @@ -281,7 +290,7 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cWebAdmin"); tolua_usertype(tolua_S,"cItem"); tolua_usertype(tolua_S,"cProjectileEntity"); - tolua_usertype(tolua_S,"HTTPRequest"); + tolua_usertype(tolua_S,"cSignEntity"); tolua_usertype(tolua_S,"cItemGrid::cListener"); tolua_usertype(tolua_S,"cDropperEntity"); } @@ -17607,6 +17616,46 @@ tolua_lerror: } #endif //#ifndef TOLUA_DISABLE +/* method: CreateByBlockType of class cBlockEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cBlockEntity_CreateByBlockType00 +static int tolua_AllToLua_cBlockEntity_CreateByBlockType00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"cBlockEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnumber(tolua_S,6,0,&tolua_err) || + !tolua_isusertype(tolua_S,7,"cWorld",1,&tolua_err) || + !tolua_isnoobj(tolua_S,8,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + unsigned char a_BlockType = (( unsigned char) tolua_tonumber(tolua_S,2,0)); + unsigned char a_BlockMeta = (( unsigned char) tolua_tonumber(tolua_S,3,0)); + int a_BlockX = ((int) tolua_tonumber(tolua_S,4,0)); + int a_BlockY = ((int) tolua_tonumber(tolua_S,5,0)); + int a_BlockZ = ((int) tolua_tonumber(tolua_S,6,0)); + cWorld* a_World = ((cWorld*) tolua_tousertype(tolua_S,7,NULL)); + { + cBlockEntity* tolua_ret = (cBlockEntity*) cBlockEntity::CreateByBlockType(a_BlockType,a_BlockMeta,a_BlockX,a_BlockY,a_BlockZ,a_World); + tolua_pushusertype(tolua_S,(void*)tolua_ret,"cBlockEntity"); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'CreateByBlockType'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: GetPosX of class cBlockEntity */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cBlockEntity_GetPosX00 static int tolua_AllToLua_cBlockEntity_GetPosX00(lua_State* tolua_S) @@ -18841,6 +18890,192 @@ static int tolua_AllToLua_cHopperEntity_new00_local(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* method: new of class cSignEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_new00 +static int tolua_AllToLua_cSignEntity_new00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"cSignEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + unsigned char a_BlockType = (( unsigned char) tolua_tonumber(tolua_S,2,0)); + int a_BlockX = ((int) tolua_tonumber(tolua_S,3,0)); + int a_BlockY = ((int) tolua_tonumber(tolua_S,4,0)); + int a_BlockZ = ((int) tolua_tonumber(tolua_S,5,0)); + { + cSignEntity* tolua_ret = (cSignEntity*) Mtolua_new((cSignEntity)(a_BlockType,a_BlockX,a_BlockY,a_BlockZ)); + tolua_pushusertype(tolua_S,(void*)tolua_ret,"cSignEntity"); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: new_local of class cSignEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_new00_local +static int tolua_AllToLua_cSignEntity_new00_local(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"cSignEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + unsigned char a_BlockType = (( unsigned char) tolua_tonumber(tolua_S,2,0)); + int a_BlockX = ((int) tolua_tonumber(tolua_S,3,0)); + int a_BlockY = ((int) tolua_tonumber(tolua_S,4,0)); + int a_BlockZ = ((int) tolua_tonumber(tolua_S,5,0)); + { + cSignEntity* tolua_ret = (cSignEntity*) Mtolua_new((cSignEntity)(a_BlockType,a_BlockX,a_BlockY,a_BlockZ)); + tolua_pushusertype(tolua_S,(void*)tolua_ret,"cSignEntity"); + tolua_register_gc(tolua_S,lua_gettop(tolua_S)); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: SetLines of class cSignEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_SetLines00 +static int tolua_AllToLua_cSignEntity_SetLines00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cSignEntity",0,&tolua_err) || + !tolua_iscppstring(tolua_S,2,0,&tolua_err) || + !tolua_iscppstring(tolua_S,3,0,&tolua_err) || + !tolua_iscppstring(tolua_S,4,0,&tolua_err) || + !tolua_iscppstring(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cSignEntity* self = (cSignEntity*) tolua_tousertype(tolua_S,1,0); + const AString a_Line1 = ((const AString) tolua_tocppstring(tolua_S,2,0)); + const AString a_Line2 = ((const AString) tolua_tocppstring(tolua_S,3,0)); + const AString a_Line3 = ((const AString) tolua_tocppstring(tolua_S,4,0)); + const AString a_Line4 = ((const AString) tolua_tocppstring(tolua_S,5,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetLines'", NULL); +#endif + { + self->SetLines(a_Line1,a_Line2,a_Line3,a_Line4); + tolua_pushcppstring(tolua_S,(const char*)a_Line1); + tolua_pushcppstring(tolua_S,(const char*)a_Line2); + tolua_pushcppstring(tolua_S,(const char*)a_Line3); + tolua_pushcppstring(tolua_S,(const char*)a_Line4); + } + } + return 4; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'SetLines'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: SetLine of class cSignEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_SetLine00 +static int tolua_AllToLua_cSignEntity_SetLine00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cSignEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_iscppstring(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cSignEntity* self = (cSignEntity*) tolua_tousertype(tolua_S,1,0); + int a_Index = ((int) tolua_tonumber(tolua_S,2,0)); + const AString a_Line = ((const AString) tolua_tocppstring(tolua_S,3,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetLine'", NULL); +#endif + { + self->SetLine(a_Index,a_Line); + tolua_pushcppstring(tolua_S,(const char*)a_Line); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'SetLine'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: GetLine of class cSignEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_GetLine00 +static int tolua_AllToLua_cSignEntity_GetLine00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const cSignEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const cSignEntity* self = (const cSignEntity*) tolua_tousertype(tolua_S,1,0); + int a_Index = ((int) tolua_tonumber(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetLine'", NULL); +#endif + { + AString tolua_ret = (AString) self->GetLine(a_Index); + tolua_pushcppstring(tolua_S,(const char*)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetLine'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* get function: Name of class HTTPFormData */ #ifndef TOLUA_DISABLE_tolua_get_HTTPFormData_Name static int tolua_get_HTTPFormData_Name(lua_State* tolua_S) @@ -27889,6 +28124,44 @@ tolua_lerror: } #endif //#ifndef TOLUA_DISABLE +/* method: GetBlockEntity of class cChunkDesc */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cChunkDesc_GetBlockEntity00 +static int tolua_AllToLua_cChunkDesc_GetBlockEntity00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cChunkDesc",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnoobj(tolua_S,5,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cChunkDesc* self = (cChunkDesc*) tolua_tousertype(tolua_S,1,0); + int a_RelX = ((int) tolua_tonumber(tolua_S,2,0)); + int a_RelY = ((int) tolua_tonumber(tolua_S,3,0)); + int a_RelZ = ((int) tolua_tonumber(tolua_S,4,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetBlockEntity'", NULL); +#endif + { + cBlockEntity* tolua_ret = (cBlockEntity*) self->GetBlockEntity(a_RelX,a_RelY,a_RelZ); + tolua_pushusertype(tolua_S,(void*)tolua_ret,"cBlockEntity"); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetBlockEntity'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: new of class cCraftingGrid */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cCraftingGrid_new00 static int tolua_AllToLua_cCraftingGrid_new00(lua_State* tolua_S) @@ -30869,6 +31142,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_cclass(tolua_S,"cBlockEntity","cBlockEntity","",NULL); #endif tolua_beginmodule(tolua_S,"cBlockEntity"); + tolua_function(tolua_S,"CreateByBlockType",tolua_AllToLua_cBlockEntity_CreateByBlockType00); tolua_function(tolua_S,"GetPosX",tolua_AllToLua_cBlockEntity_GetPosX00); tolua_function(tolua_S,"GetPosY",tolua_AllToLua_cBlockEntity_GetPosY00); tolua_function(tolua_S,"GetPosZ",tolua_AllToLua_cBlockEntity_GetPosZ00); @@ -30965,6 +31239,19 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"new_local",tolua_AllToLua_cHopperEntity_new00_local); tolua_function(tolua_S,".call",tolua_AllToLua_cHopperEntity_new00_local); tolua_endmodule(tolua_S); + #ifdef __cplusplus + tolua_cclass(tolua_S,"cSignEntity","cSignEntity","cBlockEntity",tolua_collect_cSignEntity); + #else + tolua_cclass(tolua_S,"cSignEntity","cSignEntity","cBlockEntity",NULL); + #endif + tolua_beginmodule(tolua_S,"cSignEntity"); + tolua_function(tolua_S,"new",tolua_AllToLua_cSignEntity_new00); + tolua_function(tolua_S,"new_local",tolua_AllToLua_cSignEntity_new00_local); + tolua_function(tolua_S,".call",tolua_AllToLua_cSignEntity_new00_local); + tolua_function(tolua_S,"SetLines",tolua_AllToLua_cSignEntity_SetLines00); + tolua_function(tolua_S,"SetLine",tolua_AllToLua_cSignEntity_SetLine00); + tolua_function(tolua_S,"GetLine",tolua_AllToLua_cSignEntity_GetLine00); + tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"HTTPFormData","HTTPFormData","",NULL); tolua_beginmodule(tolua_S,"HTTPFormData"); tolua_variable(tolua_S,"Name",tolua_get_HTTPFormData_Name,tolua_set_HTTPFormData_Name); @@ -31345,6 +31632,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"FloorRelCuboid",tolua_AllToLua_cChunkDesc_FloorRelCuboid01); tolua_function(tolua_S,"RandomFillRelCuboid",tolua_AllToLua_cChunkDesc_RandomFillRelCuboid00); tolua_function(tolua_S,"RandomFillRelCuboid",tolua_AllToLua_cChunkDesc_RandomFillRelCuboid01); + tolua_function(tolua_S,"GetBlockEntity",tolua_AllToLua_cChunkDesc_GetBlockEntity00); tolua_endmodule(tolua_S); #ifdef __cplusplus tolua_cclass(tolua_S,"cCraftingGrid","cCraftingGrid","",tolua_collect_cCraftingGrid); -- cgit v1.2.3 From efb6f598bca3b5dc024c7dc9c707f7efed71ef7d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 14 Nov 2013 16:05:55 +0100 Subject: Exported cJukeboxEntity to Lua API. Ref. #228 --- source/Bindings.cpp | 151 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 144 insertions(+), 7 deletions(-) (limited to 'source/Bindings.cpp') diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 6ae121f19..fb84061b6 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 11/14/13 15:31:51. +** Generated automatically by tolua++-1.0.92 on 11/14/13 15:39:43. */ #ifndef __cplusplus @@ -46,6 +46,8 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S); #include "BlockEntities/DropperEntity.h" #include "BlockEntities/FurnaceEntity.h" #include "BlockEntities/HopperEntity.h" +#include "BlockEntities/JukeboxEntity.h" +#include "BlockEntities/NoteEntity.h" #include "BlockEntities/SignEntity.h" #include "WebAdmin.h" #include "WebPlugin.h" @@ -245,6 +247,7 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cPluginManager"); tolua_usertype(tolua_S,"Vector3f"); tolua_usertype(tolua_S,"cCraftingRecipes"); + tolua_usertype(tolua_S,"cJukeboxEntity"); tolua_usertype(tolua_S,"cChestEntity"); tolua_usertype(tolua_S,"cDispenserEntity"); tolua_usertype(tolua_S,"cGhastFireballEntity"); @@ -263,21 +266,21 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"std::vector"); tolua_usertype(tolua_S,"cBlockEntityWithItems"); tolua_usertype(tolua_S,"cWindow"); - tolua_usertype(tolua_S,"HTTPFormData"); - tolua_usertype(tolua_S,"cGroup"); + tolua_usertype(tolua_S,"cItem"); + tolua_usertype(tolua_S,"cTracer"); tolua_usertype(tolua_S,"cArrowEntity"); tolua_usertype(tolua_S,"cDropSpenserEntity"); tolua_usertype(tolua_S,"cCraftingGrid"); - tolua_usertype(tolua_S,"HTTPRequest"); tolua_usertype(tolua_S,"cBlockArea"); - tolua_usertype(tolua_S,"cTracer"); + tolua_usertype(tolua_S,"cGroup"); tolua_usertype(tolua_S,"cBoundingBox"); + tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"cBlockEntity"); tolua_usertype(tolua_S,"cCriticalSection"); tolua_usertype(tolua_S,"HTTPTemplateRequest"); tolua_usertype(tolua_S,"cServer"); - tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"cPlayer"); + tolua_usertype(tolua_S,"HTTPFormData"); tolua_usertype(tolua_S,"cFile"); tolua_usertype(tolua_S,"cItems"); tolua_usertype(tolua_S,"cClientHandle"); @@ -288,7 +291,7 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"cThrownEggEntity"); tolua_usertype(tolua_S,"cGroupManager"); tolua_usertype(tolua_S,"cWebAdmin"); - tolua_usertype(tolua_S,"cItem"); + tolua_usertype(tolua_S,"HTTPRequest"); tolua_usertype(tolua_S,"cProjectileEntity"); tolua_usertype(tolua_S,"cSignEntity"); tolua_usertype(tolua_S,"cItemGrid::cListener"); @@ -18890,6 +18893,133 @@ static int tolua_AllToLua_cHopperEntity_new00_local(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* method: GetRecord of class cJukeboxEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cJukeboxEntity_GetRecord00 +static int tolua_AllToLua_cJukeboxEntity_GetRecord00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cJukeboxEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cJukeboxEntity* self = (cJukeboxEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetRecord'", NULL); +#endif + { + int tolua_ret = (int) self->GetRecord(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetRecord'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: SetRecord of class cJukeboxEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cJukeboxEntity_SetRecord00 +static int tolua_AllToLua_cJukeboxEntity_SetRecord00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cJukeboxEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cJukeboxEntity* self = (cJukeboxEntity*) tolua_tousertype(tolua_S,1,0); + int a_Record = ((int) tolua_tonumber(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetRecord'", NULL); +#endif + { + self->SetRecord(a_Record); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'SetRecord'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: PlayRecord of class cJukeboxEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cJukeboxEntity_PlayRecord00 +static int tolua_AllToLua_cJukeboxEntity_PlayRecord00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cJukeboxEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cJukeboxEntity* self = (cJukeboxEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'PlayRecord'", NULL); +#endif + { + self->PlayRecord(); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'PlayRecord'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: EjectRecord of class cJukeboxEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cJukeboxEntity_EjectRecord00 +static int tolua_AllToLua_cJukeboxEntity_EjectRecord00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cJukeboxEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cJukeboxEntity* self = (cJukeboxEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'EjectRecord'", NULL); +#endif + { + self->EjectRecord(); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'EjectRecord'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: new of class cSignEntity */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_new00 static int tolua_AllToLua_cSignEntity_new00(lua_State* tolua_S) @@ -31239,6 +31369,13 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"new_local",tolua_AllToLua_cHopperEntity_new00_local); tolua_function(tolua_S,".call",tolua_AllToLua_cHopperEntity_new00_local); tolua_endmodule(tolua_S); + tolua_cclass(tolua_S,"cJukeboxEntity","cJukeboxEntity","cBlockEntity",NULL); + tolua_beginmodule(tolua_S,"cJukeboxEntity"); + tolua_function(tolua_S,"GetRecord",tolua_AllToLua_cJukeboxEntity_GetRecord00); + tolua_function(tolua_S,"SetRecord",tolua_AllToLua_cJukeboxEntity_SetRecord00); + tolua_function(tolua_S,"PlayRecord",tolua_AllToLua_cJukeboxEntity_PlayRecord00); + tolua_function(tolua_S,"EjectRecord",tolua_AllToLua_cJukeboxEntity_EjectRecord00); + tolua_endmodule(tolua_S); #ifdef __cplusplus tolua_cclass(tolua_S,"cSignEntity","cSignEntity","cBlockEntity",tolua_collect_cSignEntity); #else -- cgit v1.2.3 From 4533fc34ecae9a7a6d89f49a6b25628dde348773 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 14 Nov 2013 17:14:54 +0100 Subject: Added cNoteEntity to Lua API. Ref. #228. --- source/Bindings.cpp | 151 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 143 insertions(+), 8 deletions(-) (limited to 'source/Bindings.cpp') diff --git a/source/Bindings.cpp b/source/Bindings.cpp index fb84061b6..c7f6ada19 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 11/14/13 15:39:43. +** Generated automatically by tolua++-1.0.92 on 11/14/13 17:13:46. */ #ifndef __cplusplus @@ -266,34 +266,35 @@ static void tolua_reg_types (lua_State* tolua_S) tolua_usertype(tolua_S,"std::vector"); tolua_usertype(tolua_S,"cBlockEntityWithItems"); tolua_usertype(tolua_S,"cWindow"); + tolua_usertype(tolua_S,"cCraftingGrid"); tolua_usertype(tolua_S,"cItem"); - tolua_usertype(tolua_S,"cTracer"); + tolua_usertype(tolua_S,"cBlockArea"); tolua_usertype(tolua_S,"cArrowEntity"); tolua_usertype(tolua_S,"cDropSpenserEntity"); - tolua_usertype(tolua_S,"cCraftingGrid"); - tolua_usertype(tolua_S,"cBlockArea"); tolua_usertype(tolua_S,"cGroup"); + tolua_usertype(tolua_S,"cTracer"); tolua_usertype(tolua_S,"cBoundingBox"); + tolua_usertype(tolua_S,"cNoteEntity"); tolua_usertype(tolua_S,"Vector3i"); tolua_usertype(tolua_S,"cBlockEntity"); tolua_usertype(tolua_S,"cCriticalSection"); tolua_usertype(tolua_S,"HTTPTemplateRequest"); - tolua_usertype(tolua_S,"cServer"); tolua_usertype(tolua_S,"cPlayer"); - tolua_usertype(tolua_S,"HTTPFormData"); + tolua_usertype(tolua_S,"cServer"); + tolua_usertype(tolua_S,"cSignEntity"); tolua_usertype(tolua_S,"cFile"); tolua_usertype(tolua_S,"cItems"); tolua_usertype(tolua_S,"cClientHandle"); tolua_usertype(tolua_S,"cIniFile"); - tolua_usertype(tolua_S,"cChatColor"); tolua_usertype(tolua_S,"cWebPlugin"); + tolua_usertype(tolua_S,"cChatColor"); tolua_usertype(tolua_S,"cPawn"); tolua_usertype(tolua_S,"cThrownEggEntity"); tolua_usertype(tolua_S,"cGroupManager"); tolua_usertype(tolua_S,"cWebAdmin"); tolua_usertype(tolua_S,"HTTPRequest"); tolua_usertype(tolua_S,"cProjectileEntity"); - tolua_usertype(tolua_S,"cSignEntity"); + tolua_usertype(tolua_S,"HTTPFormData"); tolua_usertype(tolua_S,"cItemGrid::cListener"); tolua_usertype(tolua_S,"cDropperEntity"); } @@ -19020,6 +19021,133 @@ static int tolua_AllToLua_cJukeboxEntity_EjectRecord00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE +/* method: GetPitch of class cNoteEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cNoteEntity_GetPitch00 +static int tolua_AllToLua_cNoteEntity_GetPitch00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cNoteEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cNoteEntity* self = (cNoteEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetPitch'", NULL); +#endif + { + char tolua_ret = (char) self->GetPitch(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetPitch'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: SetPitch of class cNoteEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cNoteEntity_SetPitch00 +static int tolua_AllToLua_cNoteEntity_SetPitch00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cNoteEntity",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cNoteEntity* self = (cNoteEntity*) tolua_tousertype(tolua_S,1,0); + char a_Pitch = ((char) tolua_tonumber(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetPitch'", NULL); +#endif + { + self->SetPitch(a_Pitch); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'SetPitch'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: IncrementPitch of class cNoteEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cNoteEntity_IncrementPitch00 +static int tolua_AllToLua_cNoteEntity_IncrementPitch00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cNoteEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cNoteEntity* self = (cNoteEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'IncrementPitch'", NULL); +#endif + { + self->IncrementPitch(); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'IncrementPitch'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + +/* method: MakeSound of class cNoteEntity */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cNoteEntity_MakeSound00 +static int tolua_AllToLua_cNoteEntity_MakeSound00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cNoteEntity",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + cNoteEntity* self = (cNoteEntity*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'MakeSound'", NULL); +#endif + { + self->MakeSound(); + } + } + return 0; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'MakeSound'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: new of class cSignEntity */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cSignEntity_new00 static int tolua_AllToLua_cSignEntity_new00(lua_State* tolua_S) @@ -31376,6 +31504,13 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"PlayRecord",tolua_AllToLua_cJukeboxEntity_PlayRecord00); tolua_function(tolua_S,"EjectRecord",tolua_AllToLua_cJukeboxEntity_EjectRecord00); tolua_endmodule(tolua_S); + tolua_cclass(tolua_S,"cNoteEntity","cNoteEntity","cBlockEntity",NULL); + tolua_beginmodule(tolua_S,"cNoteEntity"); + tolua_function(tolua_S,"GetPitch",tolua_AllToLua_cNoteEntity_GetPitch00); + tolua_function(tolua_S,"SetPitch",tolua_AllToLua_cNoteEntity_SetPitch00); + tolua_function(tolua_S,"IncrementPitch",tolua_AllToLua_cNoteEntity_IncrementPitch00); + tolua_function(tolua_S,"MakeSound",tolua_AllToLua_cNoteEntity_MakeSound00); + tolua_endmodule(tolua_S); #ifdef __cplusplus tolua_cclass(tolua_S,"cSignEntity","cSignEntity","cBlockEntity",tolua_collect_cSignEntity); #else -- cgit v1.2.3