From 38b219de625c6c334b1b900c911886f5469a1720 Mon Sep 17 00:00:00 2001 From: faketruth Date: Fri, 16 Mar 2012 15:48:40 +0000 Subject: Exposed a function to Lua to get a block's sky light value git-svn-id: http://mc-server.googlecode.com/svn/trunk@416 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Bindings.cpp | 70 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 30 deletions(-) (limited to 'source/Bindings.cpp') diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 8e524beb2..8e3c4bd96 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -1,6 +1,6 @@ /* ** Lua binding: AllToLua -** Generated automatically by tolua++-1.0.92 on 03/09/12 14:38:38. +** Generated automatically by tolua++-1.0.92 on 03/11/12 17:55:41. */ #ifndef __cplusplus @@ -9546,34 +9546,6 @@ static int tolua_AllToLua_cServer_SendMessage00(lua_State* tolua_S) } #endif //#ifndef TOLUA_DISABLE -/* method: GetWorld of class cWorld */ -#ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_GetWorld00 -static int tolua_AllToLua_cWorld_GetWorld00(lua_State* tolua_S) -{ -#ifndef TOLUA_RELEASE - tolua_Error tolua_err; - if ( - !tolua_isusertable(tolua_S,1,"cWorld",0,&tolua_err) || - !tolua_isnoobj(tolua_S,2,&tolua_err) - ) - goto tolua_lerror; - else -#endif - { - { - cWorld* tolua_ret = (cWorld*) cWorld::GetWorld(); - tolua_pushusertype(tolua_S,(void*)tolua_ret,"cWorld"); - } - } - return 1; -#ifndef TOLUA_RELEASE - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'GetWorld'.",&tolua_err); - return 0; -#endif -} -#endif //#ifndef TOLUA_DISABLE - /* method: GetTime of class cWorld */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_GetTime00 static int tolua_AllToLua_cWorld_GetTime00(lua_State* tolua_S) @@ -10168,6 +10140,44 @@ tolua_lerror: } #endif //#ifndef TOLUA_DISABLE +/* method: GetBlockSkyLight of class cWorld */ +#ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_GetBlockSkyLight00 +static int tolua_AllToLua_cWorld_GetBlockSkyLight00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"cWorld",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 + { + cWorld* self = (cWorld*) tolua_tousertype(tolua_S,1,0); + int a_X = ((int) tolua_tonumber(tolua_S,2,0)); + int a_Y = ((int) tolua_tonumber(tolua_S,3,0)); + int a_Z = ((int) tolua_tonumber(tolua_S,4,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetBlockSkyLight'", NULL); +#endif + { + char tolua_ret = (char) self->GetBlockSkyLight(a_X,a_Y,a_Z); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE + tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'GetBlockSkyLight'.",&tolua_err); + return 0; +#endif +} +#endif //#ifndef TOLUA_DISABLE + /* method: DigBlock of class cWorld */ #ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_DigBlock00 static int tolua_AllToLua_cWorld_DigBlock00(lua_State* tolua_S) @@ -17888,7 +17898,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_endmodule(tolua_S); tolua_cclass(tolua_S,"cWorld","cWorld","",NULL); tolua_beginmodule(tolua_S,"cWorld"); - tolua_function(tolua_S,"GetWorld",tolua_AllToLua_cWorld_GetWorld00); tolua_function(tolua_S,"GetTime",tolua_AllToLua_cWorld_GetTime00); tolua_function(tolua_S,"GetGameMode",tolua_AllToLua_cWorld_GetGameMode00); tolua_function(tolua_S,"SetWorldTime",tolua_AllToLua_cWorld_SetWorldTime00); @@ -17906,6 +17915,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S) tolua_function(tolua_S,"GetBlockMeta",tolua_AllToLua_cWorld_GetBlockMeta01); tolua_function(tolua_S,"SetBlockMeta",tolua_AllToLua_cWorld_SetBlockMeta00); tolua_function(tolua_S,"SetBlockMeta",tolua_AllToLua_cWorld_SetBlockMeta01); + tolua_function(tolua_S,"GetBlockSkyLight",tolua_AllToLua_cWorld_GetBlockSkyLight00); tolua_function(tolua_S,"DigBlock",tolua_AllToLua_cWorld_DigBlock00); tolua_function(tolua_S,"SendBlockTo",tolua_AllToLua_cWorld_SendBlockTo00); tolua_function(tolua_S,"GetSpawnX",tolua_AllToLua_cWorld_GetSpawnX00); -- cgit v1.2.3