1
0
Fork 0

Fixed bindings for cHopperEntity:GetOutputBlockPos().

This commit is contained in:
madmaxoft 2013-10-23 12:09:11 +02:00
parent 90bea6a914
commit b8a2793228
4 changed files with 48 additions and 51 deletions

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 10/23/13 11:13:15.
** Generated automatically by tolua++-1.0.92 on 10/23/13 12:07:27.
*/
#ifndef __cplusplus
@ -18924,49 +18924,6 @@ static int tolua_AllToLua_cHopperEntity_new00_local(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
/* method: GetOutputBlockPos of class cHopperEntity */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cHopperEntity_GetOutputBlockPos00
static int tolua_AllToLua_cHopperEntity_GetOutputBlockPos00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"cHopperEntity",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
{
cHopperEntity* self = (cHopperEntity*) tolua_tousertype(tolua_S,1,0);
unsigned char a_BlockMeta = (( unsigned char) tolua_tonumber(tolua_S,2,0));
int a_OutputX = ((int) tolua_tonumber(tolua_S,3,0));
int a_OutputY = ((int) tolua_tonumber(tolua_S,4,0));
int a_OutputZ = ((int) tolua_tonumber(tolua_S,5,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetOutputBlockPos'", NULL);
#endif
{
bool tolua_ret = (bool) self->GetOutputBlockPos(a_BlockMeta,a_OutputX,a_OutputY,a_OutputZ);
tolua_pushboolean(tolua_S,(bool)tolua_ret);
tolua_pushnumber(tolua_S,(lua_Number)a_OutputX);
tolua_pushnumber(tolua_S,(lua_Number)a_OutputY);
tolua_pushnumber(tolua_S,(lua_Number)a_OutputZ);
}
}
return 4;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'GetOutputBlockPos'.",&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)
@ -31034,7 +30991,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"new",tolua_AllToLua_cHopperEntity_new00);
tolua_function(tolua_S,"new_local",tolua_AllToLua_cHopperEntity_new00_local);
tolua_function(tolua_S,".call",tolua_AllToLua_cHopperEntity_new00_local);
tolua_function(tolua_S,"GetOutputBlockPos",tolua_AllToLua_cHopperEntity_GetOutputBlockPos00);
tolua_endmodule(tolua_S);
tolua_cclass(tolua_S,"HTTPFormData","HTTPFormData","",NULL);
tolua_beginmodule(tolua_S,"HTTPFormData");

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 10/23/13 11:13:15.
** Generated automatically by tolua++-1.0.92 on 10/23/13 12:07:28.
*/
/* Exported function */

View File

@ -38,15 +38,12 @@ public:
/// Constructor used for normal operation
cHopperEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
// tolua_begin
/** Returns the block coords of the block receiving the output items, based on the meta
Returns false if unattached
Returns false if unattached.
Exported in ManualBindings.cpp
*/
bool GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ);
// tolua_end
static const char * GetClassStatic(void) { return "cHopperEntity"; }
protected:

View File

@ -17,6 +17,7 @@
#include "BlockEntities/DispenserEntity.h"
#include "BlockEntities/DropperEntity.h"
#include "BlockEntities/FurnaceEntity.h"
#include "BlockEntities/HopperEntity.h"
#include "md5/md5.h"
#include "LuaWindow.h"
#include "LineBlockTracer.h"
@ -2059,6 +2060,45 @@ static int tolua_cLineBlockTracer_Trace(lua_State * tolua_S)
static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S)
{
// function cHopperEntity::GetOutputBlockPos()
// Exported manually because tolua would require meaningless params
cLuaState L(tolua_S);
if (
!L.CheckParamUserType(1, "cHopperEntity") ||
!L.CheckParamNumber (2) ||
!L.CheckParamEnd (3)
)
{
return 0;
}
cHopperEntity * self = (cHopperEntity *)tolua_tousertype(tolua_S, 1, 0);
if (self == NULL)
{
tolua_error(tolua_S, "invalid 'self' in function 'cHopperEntity::GetOutputBlockPos()'", NULL);
return 0;
}
NIBBLETYPE a_BlockMeta = ((NIBBLETYPE)tolua_tonumber(tolua_S, 2, 0));
int a_OutputX, a_OutputY, a_OutputZ;
bool res = self->GetOutputBlockPos(a_BlockMeta, a_OutputX, a_OutputY, a_OutputZ);
tolua_pushboolean(tolua_S, res);
if (res)
{
tolua_pushnumber(tolua_S, (lua_Number)a_OutputX);
tolua_pushnumber(tolua_S, (lua_Number)a_OutputY);
tolua_pushnumber(tolua_S, (lua_Number)a_OutputZ);
return 4;
}
return 1;
}
void ManualBindings::Bind(lua_State * tolua_S)
{
tolua_beginmodule(tolua_S, NULL);
@ -2070,6 +2110,10 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "LOGWARNING", tolua_LOGWARN);
tolua_function(tolua_S, "LOGERROR", tolua_LOGERROR);
tolua_beginmodule(tolua_S, "cHopperEntity");
tolua_function(tolua_S, "GetOutputBlockPos", tolua_cHopperEntity_GetOutputBlockPos);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cLineBlockTracer");
tolua_function(tolua_S, "Trace", tolua_cLineBlockTracer_Trace);
tolua_endmodule(tolua_S);