summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua9
-rw-r--r--source/Bindings.cpp2040
-rw-r--r--source/Bindings.h2
-rw-r--r--source/BlockEntities/FurnaceEntity.cpp2
-rw-r--r--source/ClientHandle.cpp34
-rw-r--r--source/ClientHandle.h2
-rw-r--r--source/OSSupport/ListenThread.cpp8
-rw-r--r--source/Piston.cpp270
-rw-r--r--source/Piston.h28
-rw-r--r--source/Protocol/Protocol.h2
-rw-r--r--source/Protocol/Protocol125.cpp30
-rw-r--r--source/Protocol/Protocol125.h2
-rw-r--r--source/Protocol/ProtocolRecognizer.cpp4
-rw-r--r--source/Protocol/ProtocolRecognizer.h2
-rw-r--r--source/UI/Window.cpp26
-rw-r--r--source/UI/Window.h10
-rw-r--r--source/virtual_method_hooks.lua2
17 files changed, 374 insertions, 2099 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index e864cfe92..2041b17ee 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -35,6 +35,7 @@ function Initialize(Plugin)
PluginManager:BindCommand("/starve", "debuggers", HandleStarveCmd, "- Sets the food level to zero");
PluginManager:BindCommand("/fl", "debuggers", HandleFoodLevelCmd, "- Sets the food level to the given value");
PluginManager:BindCommand("/spidey", "debuggers", HandleSpideyCmd, "- Shoots a line of web blocks until it hits non-air");
+ PluginManager:BindCommand("/ench", "debuggers", HandleEnchCmd, "- Provides an instant dummy enchantment window");
-- Enable the following line for BlockArea / Generator interface testing:
-- PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
@@ -739,3 +740,11 @@ end
+
+function HandleEnchCmd(a_Split, a_Player)
+ local Wnd = cLuaWindow(cWindow.Enchantment, 1, 1, "Ench")
+ a_Player:OpenWindow(Wnd)
+ Wnd:SetProperty(0, 10)
+ Wnd:SetProperty(1, 15)
+ Wnd:SetProperty(2, 25)
+end \ No newline at end of file
diff --git a/source/Bindings.cpp b/source/Bindings.cpp
index 30c5e8e34..d33be08ac 100644
--- a/source/Bindings.cpp
+++ b/source/Bindings.cpp
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 08/17/13 23:54:30.
+** Generated automatically by tolua++-1.0.92 on 08/18/13 13:15:34.
*/
#ifndef __cplusplus
@@ -203,12 +203,8 @@ static int tolua_collect_Vector3d (lua_State* tolua_S)
static void tolua_reg_types (lua_State* tolua_S)
{
tolua_usertype(tolua_S,"TakeDamageInfo");
- tolua_usertype(tolua_S,"cPlugin_NewLua");
- tolua_usertype(tolua_S,"cMonster");
- tolua_usertype(tolua_S,"cCraftingGrid");
tolua_usertype(tolua_S,"cCraftingRecipe");
tolua_usertype(tolua_S,"cPlugin");
- tolua_usertype(tolua_S,"cWindow");
tolua_usertype(tolua_S,"cStringMap");
tolua_usertype(tolua_S,"cItemGrid");
tolua_usertype(tolua_S,"cBlockArea");
@@ -216,38 +212,38 @@ static void tolua_reg_types (lua_State* tolua_S)
tolua_usertype(tolua_S,"cLuaWindow");
tolua_usertype(tolua_S,"cInventory");
tolua_usertype(tolua_S,"cRoot");
- tolua_usertype(tolua_S,"cCuboid");
+ tolua_usertype(tolua_S,"cDropperEntity");
tolua_usertype(tolua_S,"std::vector<cIniFile::key>");
- tolua_usertype(tolua_S,"cGroup");
+ tolua_usertype(tolua_S,"cMonster");
tolua_usertype(tolua_S,"cPickup");
tolua_usertype(tolua_S,"std::vector<std::string>");
- tolua_usertype(tolua_S,"cTracer");
+ tolua_usertype(tolua_S,"cWindow");
tolua_usertype(tolua_S,"cClientHandle");
tolua_usertype(tolua_S,"cChunkDesc");
tolua_usertype(tolua_S,"cFurnaceRecipe");
- tolua_usertype(tolua_S,"Vector3i");
+ tolua_usertype(tolua_S,"cCraftingGrid");
tolua_usertype(tolua_S,"cChatColor");
- tolua_usertype(tolua_S,"cWorld");
- tolua_usertype(tolua_S,"Lua__cPickup");
- tolua_usertype(tolua_S,"Lua__cWebPlugin");
- tolua_usertype(tolua_S,"cCraftingRecipes");
- tolua_usertype(tolua_S,"cEntity");
+ tolua_usertype(tolua_S,"cGroup");
+ tolua_usertype(tolua_S,"cTracer");
+ tolua_usertype(tolua_S,"cCuboid");
+ tolua_usertype(tolua_S,"Vector3i");
+ tolua_usertype(tolua_S,"cPlugin_NewLua");
tolua_usertype(tolua_S,"cItem");
tolua_usertype(tolua_S,"Vector3f");
- tolua_usertype(tolua_S,"cWebPlugin");
+ tolua_usertype(tolua_S,"cCraftingRecipes");
tolua_usertype(tolua_S,"cDropSpenserEntity");
- tolua_usertype(tolua_S,"Lua__cPlayer");
- tolua_usertype(tolua_S,"cWebAdmin");
+ tolua_usertype(tolua_S,"cWorld");
+ tolua_usertype(tolua_S,"cWebPlugin");
tolua_usertype(tolua_S,"cChestEntity");
tolua_usertype(tolua_S,"cDispenserEntity");
- tolua_usertype(tolua_S,"sWebAdminPage");
+ tolua_usertype(tolua_S,"cWebAdmin");
tolua_usertype(tolua_S,"cBlockEntity");
tolua_usertype(tolua_S,"cCriticalSection");
tolua_usertype(tolua_S,"HTTPTemplateRequest");
+ tolua_usertype(tolua_S,"sWebAdminPage");
tolua_usertype(tolua_S,"HTTPRequest");
tolua_usertype(tolua_S,"HTTPFormData");
tolua_usertype(tolua_S,"cFurnaceEntity");
- tolua_usertype(tolua_S,"cDropperEntity");
tolua_usertype(tolua_S,"cLineBlockTracer");
tolua_usertype(tolua_S,"cPluginManager");
tolua_usertype(tolua_S,"cIniFile");
@@ -257,10 +253,10 @@ static void tolua_reg_types (lua_State* tolua_S)
tolua_usertype(tolua_S,"cPlayer");
tolua_usertype(tolua_S,"cGroupManager");
tolua_usertype(tolua_S,"cBlockEntityWindowOwner");
+ tolua_usertype(tolua_S,"cEntity");
tolua_usertype(tolua_S,"cItemGrid::cListener");
tolua_usertype(tolua_S,"cServer");
tolua_usertype(tolua_S,"cItems");
- tolua_usertype(tolua_S,"Lua__cEntity");
tolua_usertype(tolua_S,"Vector3d");
}
@@ -7273,970 +7269,6 @@ static int tolua_AllToLua_cEntity_IsRclking00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
- class Lua__cEntity : public cEntity, public ToluaBase {
-public:
- bool IsA( const char* a_ClassName)const {
- if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) {
- tolua_pushstring(lua_state, (const char*)a_ClassName);
- ToluaBase::dbcall(lua_state, 2, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsA(a_ClassName);
- };
- };
- const char* GetClass( void )const {
- if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cEntity:: GetClass();
- };
- };
- const char* GetParentClass( void )const {
- if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cEntity:: GetParentClass();
- };
- };
- int GetRawDamageAgainst( const cEntity& a_Receiver) {
- if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cEntity:: GetRawDamageAgainst(a_Receiver);
- };
- };
- int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) {
- tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity");
- tolua_pushnumber(lua_state, (lua_Number)a_DamageType);
- tolua_pushnumber(lua_state, (lua_Number)a_RawDamage);
- ToluaBase::dbcall(lua_state, 4, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cEntity:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- };
- double GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( double ) cEntity:: GetKnockbackAmountAgainst(a_Receiver);
- };
- };
- cItem GetEquippedWeapon( void )const {
- if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cEntity:: GetEquippedWeapon();
- };
- };
- cItem GetEquippedHelmet( void )const {
- if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cEntity:: GetEquippedHelmet();
- };
- };
- cItem GetEquippedChestplate( void )const {
- if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cEntity:: GetEquippedChestplate();
- };
- };
- cItem GetEquippedLeggings( void )const {
- if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cEntity:: GetEquippedLeggings();
- };
- };
- cItem GetEquippedBoots( void )const {
- if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cEntity:: GetEquippedBoots();
- };
- };
- void KilledBy( cEntity* a_Killer) {
- if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) {
- tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cEntity:: KilledBy(a_Killer);
- };
- };
- void TeleportToEntity( cEntity& a_Entity) {
- if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) {
- tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cEntity:: TeleportToEntity(a_Entity);
- };
- };
- void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) {
- tolua_pushnumber(lua_state, (lua_Number)a_PosX);
- tolua_pushnumber(lua_state, (lua_Number)a_PosY);
- tolua_pushnumber(lua_state, (lua_Number)a_PosZ);
- ToluaBase::dbcall(lua_state, 4, 0);
- } else {
- return ( void ) cEntity:: TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- };
- bool IsOnFire( void )const {
- if (push_method("IsOnFire", tolua_AllToLua_cEntity_IsOnFire00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsOnFire();
- };
- };
- bool IsCrouched( void )const {
- if (push_method("IsCrouched", tolua_AllToLua_cEntity_IsCrouched00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsCrouched();
- };
- };
- bool IsRiding( void )const {
- if (push_method("IsRiding", tolua_AllToLua_cEntity_IsRiding00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsRiding();
- };
- };
- bool IsSprinting( void )const {
- if (push_method("IsSprinting", tolua_AllToLua_cEntity_IsSprinting00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsSprinting();
- };
- };
- bool IsRclking( void )const {
- if (push_method("IsRclking", tolua_AllToLua_cEntity_IsRclking00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cEntity:: IsRclking();
- };
- };
-
- bool cEntity__IsA( const char* a_ClassName) {
- return ( bool )cEntity::IsA(a_ClassName);
- };
- const char* cEntity__GetClass( void ) {
- return ( const char* )cEntity::GetClass();
- };
- const char* cEntity__GetParentClass( void ) {
- return ( const char* )cEntity::GetParentClass();
- };
- int cEntity__GetRawDamageAgainst( const cEntity& a_Receiver) {
- return ( int )cEntity::GetRawDamageAgainst(a_Receiver);
- };
- int cEntity__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- return ( int )cEntity::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- double cEntity__GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- return ( double )cEntity::GetKnockbackAmountAgainst(a_Receiver);
- };
- cItem cEntity__GetEquippedWeapon( void ) {
- return ( cItem )cEntity::GetEquippedWeapon();
- };
- cItem cEntity__GetEquippedHelmet( void ) {
- return ( cItem )cEntity::GetEquippedHelmet();
- };
- cItem cEntity__GetEquippedChestplate( void ) {
- return ( cItem )cEntity::GetEquippedChestplate();
- };
- cItem cEntity__GetEquippedLeggings( void ) {
- return ( cItem )cEntity::GetEquippedLeggings();
- };
- cItem cEntity__GetEquippedBoots( void ) {
- return ( cItem )cEntity::GetEquippedBoots();
- };
- void cEntity__KilledBy( cEntity* a_Killer) {
- return ( void )cEntity::KilledBy(a_Killer);
- };
- void cEntity__TeleportToEntity( cEntity& a_Entity) {
- return ( void )cEntity::TeleportToEntity(a_Entity);
- };
- void cEntity__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- return ( void )cEntity::TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- bool cEntity__IsOnFire( void ) {
- return ( bool )cEntity::IsOnFire();
- };
- bool cEntity__IsCrouched( void ) {
- return ( bool )cEntity::IsCrouched();
- };
- bool cEntity__IsRiding( void ) {
- return ( bool )cEntity::IsRiding();
- };
- bool cEntity__IsSprinting( void ) {
- return ( bool )cEntity::IsSprinting();
- };
- bool cEntity__IsRclking( void ) {
- return ( bool )cEntity::IsRclking();
- };
-};
-
-/* method: tolua__set_instance of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_tolua__set_instance00
-static int tolua_AllToLua_Lua__cEntity_tolua__set_instance00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- lua_State* L = tolua_S;
- lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'tolua__set_instance'", NULL);
-#endif
- {
- self->tolua__set_instance(L,lo);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'tolua__set_instance'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsA of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsA00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsA00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isstring(tolua_S,2,0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- const char* a_ClassName = ((const char*) tolua_tostring(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsA'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsA(a_ClassName);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsA'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetClass of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetClass00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetClass00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetClass'", NULL);
-#endif
- {
- const char* tolua_ret = (const char*) self->cEntity__GetClass();
- tolua_pushstring(tolua_S,(const char*)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetClass'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetParentClass of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetParentClass'", NULL);
-#endif
- {
- const char* tolua_ret = (const char*) self->cEntity__GetParentClass();
- tolua_pushstring(tolua_S,(const char*)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetParentClass'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetRawDamageAgainst of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetRawDamageAgainst'", NULL);
-#endif
- {
- int tolua_ret = (int) self->cEntity__GetRawDamageAgainst(*a_Receiver);
- tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetRawDamageAgainst'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetArmorCoverAgainst of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"const cEntity",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
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- const cEntity* a_Attacker = ((const cEntity*) tolua_tousertype(tolua_S,2,0));
- eDamageType a_DamageType = ((eDamageType) (int) tolua_tonumber(tolua_S,3,0));
- int a_RawDamage = ((int) tolua_tonumber(tolua_S,4,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetArmorCoverAgainst'", NULL);
-#endif
- {
- int tolua_ret = (int) self->cEntity__GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetArmorCoverAgainst'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetKnockbackAmountAgainst of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const cEntity",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- const cEntity* a_Receiver = ((const cEntity*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetKnockbackAmountAgainst'", NULL);
-#endif
- {
- double tolua_ret = (double) self->cEntity__GetKnockbackAmountAgainst(*a_Receiver);
- tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetKnockbackAmountAgainst'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetEquippedWeapon of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedWeapon'", NULL);
-#endif
- {
- cItem tolua_ret = (cItem) self->cEntity__GetEquippedWeapon();
- {
-#ifdef __cplusplus
- void* tolua_obj = Mtolua_new((cItem)(tolua_ret));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#else
- void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#endif
- }
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedWeapon'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetEquippedHelmet of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedHelmet'", NULL);
-#endif
- {
- cItem tolua_ret = (cItem) self->cEntity__GetEquippedHelmet();
- {
-#ifdef __cplusplus
- void* tolua_obj = Mtolua_new((cItem)(tolua_ret));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#else
- void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#endif
- }
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedHelmet'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetEquippedChestplate of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedChestplate'", NULL);
-#endif
- {
- cItem tolua_ret = (cItem) self->cEntity__GetEquippedChestplate();
- {
-#ifdef __cplusplus
- void* tolua_obj = Mtolua_new((cItem)(tolua_ret));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#else
- void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#endif
- }
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedChestplate'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetEquippedLeggings of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedLeggings'", NULL);
-#endif
- {
- cItem tolua_ret = (cItem) self->cEntity__GetEquippedLeggings();
- {
-#ifdef __cplusplus
- void* tolua_obj = Mtolua_new((cItem)(tolua_ret));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#else
- void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#endif
- }
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedLeggings'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__GetEquippedBoots of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00
-static int tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__GetEquippedBoots'", NULL);
-#endif
- {
- cItem tolua_ret = (cItem) self->cEntity__GetEquippedBoots();
- {
-#ifdef __cplusplus
- void* tolua_obj = Mtolua_new((cItem)(tolua_ret));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#else
- void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(cItem));
- tolua_pushusertype(tolua_S,tolua_obj,"cItem");
- tolua_register_gc(tolua_S,lua_gettop(tolua_S));
-#endif
- }
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__GetEquippedBoots'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__KilledBy of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00
-static int tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- cEntity* a_Killer = ((cEntity*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__KilledBy'", NULL);
-#endif
- {
- self->cEntity__KilledBy(a_Killer);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__KilledBy'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__TeleportToEntity of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00
-static int tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"cEntity",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- cEntity* a_Entity = ((cEntity*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__TeleportToEntity'", NULL);
-#endif
- {
- self->cEntity__TeleportToEntity(*a_Entity);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__TeleportToEntity'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__TeleportToCoords of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00
-static int tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",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
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
- double a_PosX = ((double) tolua_tonumber(tolua_S,2,0));
- double a_PosY = ((double) tolua_tonumber(tolua_S,3,0));
- double a_PosZ = ((double) tolua_tonumber(tolua_S,4,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__TeleportToCoords'", NULL);
-#endif
- {
- self->cEntity__TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__TeleportToCoords'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsOnFire of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsOnFire'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsOnFire();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsOnFire'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsCrouched of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsCrouched'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsCrouched();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsCrouched'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsRiding of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRiding'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsRiding();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsRiding'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsSprinting of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsSprinting'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsSprinting();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsSprinting'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cEntity__IsRclking of class Lua__cEntity */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00
-static int tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cEntity",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cEntity* self = (Lua__cEntity*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cEntity__IsRclking'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cEntity__IsRclking();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cEntity__IsRclking'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
/* method: GetEyeHeight of class cPlayer */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cPlayer_GetEyeHeight00
static int tolua_AllToLua_cPlayer_GetEyeHeight00(lua_State* tolua_S)
@@ -10150,427 +9182,6 @@ static int tolua_AllToLua_cPlayer_IsSubmerged00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
- class Lua__cPlayer : public cPlayer, public ToluaBase {
-public:
- void MoveTo( const Vector3d& a_NewPos) {
- if (push_method("MoveTo", tolua_AllToLua_cPlayer_MoveTo00)) {
- tolua_pushusertype(lua_state, (void*)&a_NewPos, "const Vector3d");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cPlayer:: MoveTo(a_NewPos);
- };
- };
- bool IsSwimming( void )const {
- if (push_method("IsSwimming", tolua_AllToLua_cPlayer_IsSwimming00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsSwimming();
- };
- };
- bool IsSubmerged( void )const {
- if (push_method("IsSubmerged", tolua_AllToLua_cPlayer_IsSubmerged00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsSubmerged();
- };
- };
- bool IsA( const char* a_ClassName)const {
- if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) {
- tolua_pushstring(lua_state, (const char*)a_ClassName);
- ToluaBase::dbcall(lua_state, 2, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsA(a_ClassName);
- };
- };
- const char* GetClass( void )const {
- if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cPlayer:: GetClass();
- };
- };
- const char* GetParentClass( void )const {
- if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cPlayer:: GetParentClass();
- };
- };
- int GetRawDamageAgainst( const cEntity& a_Receiver) {
- if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cPlayer:: GetRawDamageAgainst(a_Receiver);
- };
- };
- int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) {
- tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity");
- tolua_pushnumber(lua_state, (lua_Number)a_DamageType);
- tolua_pushnumber(lua_state, (lua_Number)a_RawDamage);
- ToluaBase::dbcall(lua_state, 4, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cPlayer:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- };
- double GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( double ) cPlayer:: GetKnockbackAmountAgainst(a_Receiver);
- };
- };
- cItem GetEquippedWeapon( void )const {
- if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPlayer:: GetEquippedWeapon();
- };
- };
- cItem GetEquippedHelmet( void )const {
- if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPlayer:: GetEquippedHelmet();
- };
- };
- cItem GetEquippedChestplate( void )const {
- if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPlayer:: GetEquippedChestplate();
- };
- };
- cItem GetEquippedLeggings( void )const {
- if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPlayer:: GetEquippedLeggings();
- };
- };
- cItem GetEquippedBoots( void )const {
- if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPlayer:: GetEquippedBoots();
- };
- };
- void KilledBy( cEntity* a_Killer) {
- if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) {
- tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cPlayer:: KilledBy(a_Killer);
- };
- };
- void TeleportToEntity( cEntity& a_Entity) {
- if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) {
- tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cPlayer:: TeleportToEntity(a_Entity);
- };
- };
- void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) {
- tolua_pushnumber(lua_state, (lua_Number)a_PosX);
- tolua_pushnumber(lua_state, (lua_Number)a_PosY);
- tolua_pushnumber(lua_state, (lua_Number)a_PosZ);
- ToluaBase::dbcall(lua_state, 4, 0);
- } else {
- return ( void ) cPlayer:: TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- };
- bool IsOnFire( void )const {
- if (push_method("IsOnFire", tolua_AllToLua_cEntity_IsOnFire00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsOnFire();
- };
- };
- bool IsCrouched( void )const {
- if (push_method("IsCrouched", tolua_AllToLua_cEntity_IsCrouched00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsCrouched();
- };
- };
- bool IsRiding( void )const {
- if (push_method("IsRiding", tolua_AllToLua_cEntity_IsRiding00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsRiding();
- };
- };
- bool IsSprinting( void )const {
- if (push_method("IsSprinting", tolua_AllToLua_cEntity_IsSprinting00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsSprinting();
- };
- };
- bool IsRclking( void )const {
- if (push_method("IsRclking", tolua_AllToLua_cEntity_IsRclking00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPlayer:: IsRclking();
- };
- };
-
- void cPlayer__MoveTo( const Vector3d& a_NewPos) {
- return ( void )cPlayer::MoveTo(a_NewPos);
- };
- bool cPlayer__IsSwimming( void ) {
- return ( bool )cPlayer::IsSwimming();
- };
- bool cPlayer__IsSubmerged( void ) {
- return ( bool )cPlayer::IsSubmerged();
- };
- bool cPlayer__IsA( const char* a_ClassName) {
- return ( bool )cPlayer::IsA(a_ClassName);
- };
- const char* cPlayer__GetClass( void ) {
- return ( const char* )cPlayer::GetClass();
- };
- const char* cPlayer__GetParentClass( void ) {
- return ( const char* )cPlayer::GetParentClass();
- };
- int cPlayer__GetRawDamageAgainst( const cEntity& a_Receiver) {
- return ( int )cPlayer::GetRawDamageAgainst(a_Receiver);
- };
- int cPlayer__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- return ( int )cPlayer::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- double cPlayer__GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- return ( double )cPlayer::GetKnockbackAmountAgainst(a_Receiver);
- };
- cItem cPlayer__GetEquippedWeapon( void ) {
- return ( cItem )cPlayer::GetEquippedWeapon();
- };
- cItem cPlayer__GetEquippedHelmet( void ) {
- return ( cItem )cPlayer::GetEquippedHelmet();
- };
- cItem cPlayer__GetEquippedChestplate( void ) {
- return ( cItem )cPlayer::GetEquippedChestplate();
- };
- cItem cPlayer__GetEquippedLeggings( void ) {
- return ( cItem )cPlayer::GetEquippedLeggings();
- };
- cItem cPlayer__GetEquippedBoots( void ) {
- return ( cItem )cPlayer::GetEquippedBoots();
- };
- void cPlayer__KilledBy( cEntity* a_Killer) {
- return ( void )cPlayer::KilledBy(a_Killer);
- };
- void cPlayer__TeleportToEntity( cEntity& a_Entity) {
- return ( void )cPlayer::TeleportToEntity(a_Entity);
- };
- void cPlayer__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- return ( void )cPlayer::TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- bool cPlayer__IsOnFire( void ) {
- return ( bool )cPlayer::IsOnFire();
- };
- bool cPlayer__IsCrouched( void ) {
- return ( bool )cPlayer::IsCrouched();
- };
- bool cPlayer__IsRiding( void ) {
- return ( bool )cPlayer::IsRiding();
- };
- bool cPlayer__IsSprinting( void ) {
- return ( bool )cPlayer::IsSprinting();
- };
- bool cPlayer__IsRclking( void ) {
- return ( bool )cPlayer::IsRclking();
- };
-};
-
-/* method: tolua__set_instance of class Lua__cPlayer */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPlayer_tolua__set_instance00
-static int tolua_AllToLua_Lua__cPlayer_tolua__set_instance00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPlayer",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPlayer* self = (Lua__cPlayer*) tolua_tousertype(tolua_S,1,0);
- lua_State* L = tolua_S;
- lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'tolua__set_instance'", NULL);
-#endif
- {
- self->tolua__set_instance(L,lo);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'tolua__set_instance'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cPlayer__MoveTo of class Lua__cPlayer */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPlayer_cPlayer__MoveTo00
-static int tolua_AllToLua_Lua__cPlayer_cPlayer__MoveTo00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPlayer",0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,2,&tolua_err) || !tolua_isusertype(tolua_S,2,"const Vector3d",0,&tolua_err)) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPlayer* self = (Lua__cPlayer*) tolua_tousertype(tolua_S,1,0);
- const Vector3d* a_NewPos = ((const Vector3d*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPlayer__MoveTo'", NULL);
-#endif
- {
- self->cPlayer__MoveTo(*a_NewPos);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cPlayer__MoveTo'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cPlayer__IsSwimming of class Lua__cPlayer */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPlayer_cPlayer__IsSwimming00
-static int tolua_AllToLua_Lua__cPlayer_cPlayer__IsSwimming00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPlayer",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPlayer* self = (Lua__cPlayer*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPlayer__IsSwimming'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cPlayer__IsSwimming();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cPlayer__IsSwimming'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cPlayer__IsSubmerged of class Lua__cPlayer */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPlayer_cPlayer__IsSubmerged00
-static int tolua_AllToLua_Lua__cPlayer_cPlayer__IsSubmerged00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPlayer",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,2,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPlayer* self = (Lua__cPlayer*) tolua_tousertype(tolua_S,1,0);
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPlayer__IsSubmerged'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cPlayer__IsSubmerged();
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cPlayer__IsSubmerged'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
/* method: Get of class cPluginManager */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cPluginManager_Get00
static int tolua_AllToLua_cPluginManager_Get00(lua_State* tolua_S)
@@ -19238,77 +17849,6 @@ static int tolua_AllToLua_cWebPlugin_SafeString00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
- class Lua__cWebPlugin : public cWebPlugin, public ToluaBase {
-public:
- const AString GetWebTitle( void )const {
- if (push_method("GetWebTitle", tolua_AllToLua_cWebPlugin_GetWebTitle00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const AString tolua_ret = ( const AString )tolua_tocppstring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- if (lua_state)
- LOG("pure-virtual method cWebPlugin::GetWebTitle not implemented.");
- else {
- LOG("pure-virtual method cWebPlugin::GetWebTitle called with no lua_state. Aborting");
- ::abort();
- };
- return ( const AString )0;
- };
- };
- AString HandleWebRequest( const HTTPRequest* a_Request) {
- if (push_method("HandleWebRequest", tolua_AllToLua_cWebPlugin_HandleWebRequest00)) {
- tolua_pushusertype(lua_state, (void*)a_Request, "const HTTPRequest");
- ToluaBase::dbcall(lua_state, 2, 1);
- AString tolua_ret = ( AString )tolua_tocppstring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- if (lua_state)
- LOG("pure-virtual method cWebPlugin::HandleWebRequest not implemented.");
- else {
- LOG("pure-virtual method cWebPlugin::HandleWebRequest called with no lua_state. Aborting");
- ::abort();
- };
- return ( AString )0;
- };
- };
-
-};
-
-/* method: tolua__set_instance of class Lua__cWebPlugin */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cWebPlugin_tolua__set_instance00
-static int tolua_AllToLua_Lua__cWebPlugin_tolua__set_instance00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cWebPlugin",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cWebPlugin* self = (Lua__cWebPlugin*) tolua_tousertype(tolua_S,1,0);
- lua_State* L = tolua_S;
- lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'tolua__set_instance'", NULL);
-#endif
- {
- self->tolua__set_instance(L,lo);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'tolua__set_instance'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
/* method: new of class cPickup */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cPickup_new00
static int tolua_AllToLua_cPickup_new00(lua_State* tolua_S)
@@ -19460,439 +18000,6 @@ static int tolua_AllToLua_cPickup_CollectedBy00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
- class Lua__cPickup : public cPickup, public ToluaBase {
-public:
- bool CollectedBy( cPlayer* a_Dest) {
- if (push_method("CollectedBy", tolua_AllToLua_cPickup_CollectedBy00)) {
- tolua_pushusertype(lua_state, (void*)a_Dest, "cPlayer");
- ToluaBase::dbcall(lua_state, 2, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: CollectedBy(a_Dest);
- };
- };
- bool IsA( const char* a_ClassName)const {
- if (push_method("IsA", tolua_AllToLua_cEntity_IsA00)) {
- tolua_pushstring(lua_state, (const char*)a_ClassName);
- ToluaBase::dbcall(lua_state, 2, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsA(a_ClassName);
- };
- };
- const char* GetClass( void )const {
- if (push_method("GetClass", tolua_AllToLua_cEntity_GetClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cPickup:: GetClass();
- };
- };
- const char* GetParentClass( void )const {
- if (push_method("GetParentClass", tolua_AllToLua_cEntity_GetParentClass00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- const char* tolua_ret = ( const char* )tolua_tostring(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( const char* ) cPickup:: GetParentClass();
- };
- };
- int GetRawDamageAgainst( const cEntity& a_Receiver) {
- if (push_method("GetRawDamageAgainst", tolua_AllToLua_cEntity_GetRawDamageAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cPickup:: GetRawDamageAgainst(a_Receiver);
- };
- };
- int GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- if (push_method("GetArmorCoverAgainst", tolua_AllToLua_cEntity_GetArmorCoverAgainst00)) {
- tolua_pushusertype(lua_state, (void*)a_Attacker, "const cEntity");
- tolua_pushnumber(lua_state, (lua_Number)a_DamageType);
- tolua_pushnumber(lua_state, (lua_Number)a_RawDamage);
- ToluaBase::dbcall(lua_state, 4, 1);
- int tolua_ret = ( int )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( int ) cPickup:: GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- };
- double GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- if (push_method("GetKnockbackAmountAgainst", tolua_AllToLua_cEntity_GetKnockbackAmountAgainst00)) {
- tolua_pushusertype(lua_state, (void*)&a_Receiver, "const cEntity");
- ToluaBase::dbcall(lua_state, 2, 1);
- double tolua_ret = ( double )tolua_tonumber(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( double ) cPickup:: GetKnockbackAmountAgainst(a_Receiver);
- };
- };
- cItem GetEquippedWeapon( void )const {
- if (push_method("GetEquippedWeapon", tolua_AllToLua_cEntity_GetEquippedWeapon00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPickup:: GetEquippedWeapon();
- };
- };
- cItem GetEquippedHelmet( void )const {
- if (push_method("GetEquippedHelmet", tolua_AllToLua_cEntity_GetEquippedHelmet00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPickup:: GetEquippedHelmet();
- };
- };
- cItem GetEquippedChestplate( void )const {
- if (push_method("GetEquippedChestplate", tolua_AllToLua_cEntity_GetEquippedChestplate00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPickup:: GetEquippedChestplate();
- };
- };
- cItem GetEquippedLeggings( void )const {
- if (push_method("GetEquippedLeggings", tolua_AllToLua_cEntity_GetEquippedLeggings00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPickup:: GetEquippedLeggings();
- };
- };
- cItem GetEquippedBoots( void )const {
- if (push_method("GetEquippedBoots", tolua_AllToLua_cEntity_GetEquippedBoots00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- cItem tolua_ret = ( cItem )*(cItem*)tolua_tousertype(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( cItem ) cPickup:: GetEquippedBoots();
- };
- };
- void KilledBy( cEntity* a_Killer) {
- if (push_method("KilledBy", tolua_AllToLua_cEntity_KilledBy00)) {
- tolua_pushusertype(lua_state, (void*)a_Killer, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cPickup:: KilledBy(a_Killer);
- };
- };
- void TeleportToEntity( cEntity& a_Entity) {
- if (push_method("TeleportToEntity", tolua_AllToLua_cEntity_TeleportToEntity00)) {
- tolua_pushusertype(lua_state, (void*)&a_Entity, "cEntity");
- ToluaBase::dbcall(lua_state, 2, 0);
- } else {
- return ( void ) cPickup:: TeleportToEntity(a_Entity);
- };
- };
- void TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- if (push_method("TeleportToCoords", tolua_AllToLua_cEntity_TeleportToCoords00)) {
- tolua_pushnumber(lua_state, (lua_Number)a_PosX);
- tolua_pushnumber(lua_state, (lua_Number)a_PosY);
- tolua_pushnumber(lua_state, (lua_Number)a_PosZ);
- ToluaBase::dbcall(lua_state, 4, 0);
- } else {
- return ( void ) cPickup:: TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- };
- bool IsOnFire( void )const {
- if (push_method("IsOnFire", tolua_AllToLua_cEntity_IsOnFire00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsOnFire();
- };
- };
- bool IsCrouched( void )const {
- if (push_method("IsCrouched", tolua_AllToLua_cEntity_IsCrouched00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsCrouched();
- };
- };
- bool IsRiding( void )const {
- if (push_method("IsRiding", tolua_AllToLua_cEntity_IsRiding00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsRiding();
- };
- };
- bool IsSprinting( void )const {
- if (push_method("IsSprinting", tolua_AllToLua_cEntity_IsSprinting00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsSprinting();
- };
- };
- bool IsRclking( void )const {
- if (push_method("IsRclking", tolua_AllToLua_cEntity_IsRclking00)) {
- ToluaBase::dbcall(lua_state, 1, 1);
- bool tolua_ret = ( bool )tolua_toboolean(lua_state, -1, 0);
- lua_pop(lua_state, 1);
- return tolua_ret;
- } else {
- return ( bool ) cPickup:: IsRclking();
- };
- };
-
- bool cPickup__CollectedBy( cPlayer* a_Dest) {
- return ( bool )cPickup::CollectedBy(a_Dest);
- };
- bool cPickup__IsA( const char* a_ClassName) {
- return ( bool )cPickup::IsA(a_ClassName);
- };
- const char* cPickup__GetClass( void ) {
- return ( const char* )cPickup::GetClass();
- };
- const char* cPickup__GetParentClass( void ) {
- return ( const char* )cPickup::GetParentClass();
- };
- int cPickup__GetRawDamageAgainst( const cEntity& a_Receiver) {
- return ( int )cPickup::GetRawDamageAgainst(a_Receiver);
- };
- int cPickup__GetArmorCoverAgainst( const cEntity* a_Attacker, eDamageType a_DamageType, int a_RawDamage) {
- return ( int )cPickup::GetArmorCoverAgainst(a_Attacker,a_DamageType,a_RawDamage);
- };
- double cPickup__GetKnockbackAmountAgainst( const cEntity& a_Receiver) {
- return ( double )cPickup::GetKnockbackAmountAgainst(a_Receiver);
- };
- cItem cPickup__GetEquippedWeapon( void ) {
- return ( cItem )cPickup::GetEquippedWeapon();
- };
- cItem cPickup__GetEquippedHelmet( void ) {
- return ( cItem )cPickup::GetEquippedHelmet();
- };
- cItem cPickup__GetEquippedChestplate( void ) {
- return ( cItem )cPickup::GetEquippedChestplate();
- };
- cItem cPickup__GetEquippedLeggings( void ) {
- return ( cItem )cPickup::GetEquippedLeggings();
- };
- cItem cPickup__GetEquippedBoots( void ) {
- return ( cItem )cPickup::GetEquippedBoots();
- };
- void cPickup__KilledBy( cEntity* a_Killer) {
- return ( void )cPickup::KilledBy(a_Killer);
- };
- void cPickup__TeleportToEntity( cEntity& a_Entity) {
- return ( void )cPickup::TeleportToEntity(a_Entity);
- };
- void cPickup__TeleportToCoords( double a_PosX, double a_PosY, double a_PosZ) {
- return ( void )cPickup::TeleportToCoords(a_PosX,a_PosY,a_PosZ);
- };
- bool cPickup__IsOnFire( void ) {
- return ( bool )cPickup::IsOnFire();
- };
- bool cPickup__IsCrouched( void ) {
- return ( bool )cPickup::IsCrouched();
- };
- bool cPickup__IsRiding( void ) {
- return ( bool )cPickup::IsRiding();
- };
- bool cPickup__IsSprinting( void ) {
- return ( bool )cPickup::IsSprinting();
- };
- bool cPickup__IsRclking( void ) {
- return ( bool )cPickup::IsRclking();
- };
- Lua__cPickup( int a_MicroPosX, int a_MicroPosY, int a_MicroPosZ, const cItem& a_Item, float a_SpeedX = 0.f, float a_SpeedY = 0.f, float a_SpeedZ = 0.f): cPickup(a_MicroPosX,a_MicroPosY,a_MicroPosZ,a_Item,a_SpeedX,a_SpeedY,a_SpeedZ){};
-};
-
-/* method: tolua__set_instance of class Lua__cPickup */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPickup_tolua__set_instance00
-static int tolua_AllToLua_Lua__cPickup_tolua__set_instance00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPickup",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPickup* self = (Lua__cPickup*) tolua_tousertype(tolua_S,1,0);
- lua_State* L = tolua_S;
- lua_Object lo = ((lua_Object) tolua_tovalue(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'tolua__set_instance'", NULL);
-#endif
- {
- self->tolua__set_instance(L,lo);
- }
- }
- return 0;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'tolua__set_instance'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: cPickup__CollectedBy of class Lua__cPickup */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPickup_cPickup__CollectedBy00
-static int tolua_AllToLua_Lua__cPickup_cPickup__CollectedBy00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertype(tolua_S,1,"Lua__cPickup",0,&tolua_err) ||
- !tolua_isusertype(tolua_S,2,"cPlayer",0,&tolua_err) ||
- !tolua_isnoobj(tolua_S,3,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- Lua__cPickup* self = (Lua__cPickup*) tolua_tousertype(tolua_S,1,0);
- cPlayer* a_Dest = ((cPlayer*) tolua_tousertype(tolua_S,2,0));
-#ifndef TOLUA_RELEASE
- if (!self) tolua_error(tolua_S,"invalid 'self' in function 'cPickup__CollectedBy'", NULL);
-#endif
- {
- bool tolua_ret = (bool) self->cPickup__CollectedBy(a_Dest);
- tolua_pushboolean(tolua_S,(bool)tolua_ret);
- }
- }
- return 1;
-#ifndef TOLUA_RELEASE
- tolua_lerror:
- tolua_error(tolua_S,"#ferror in function 'cPickup__CollectedBy'.",&tolua_err);
- return 0;
-#endif
-}
-#endif //#ifndef TOLUA_DISABLE
-
-/* method: new of class Lua__cPickup */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPickup_new00
-static int tolua_AllToLua_Lua__cPickup_new00(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Lua__cPickup",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_isvaluenil(tolua_S,5,&tolua_err) || !tolua_isusertype(tolua_S,5,"cItem",0,&tolua_err)) ||
- !tolua_isnumber(tolua_S,6,1,&tolua_err) ||
- !tolua_isnumber(tolua_S,7,1,&tolua_err) ||
- !tolua_isnumber(tolua_S,8,1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,9,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- int a_MicroPosX = ((int) tolua_tonumber(tolua_S,2,0));
- int a_MicroPosY = ((int) tolua_tonumber(tolua_S,3,0));
- int a_MicroPosZ = ((int) tolua_tonumber(tolua_S,4,0));
- const cItem* a_Item = ((const cItem*) tolua_tousertype(tolua_S,5,0));
- float a_SpeedX = ((float) tolua_tonumber(tolua_S,6,0.f));
- float a_SpeedY = ((float) tolua_tonumber(tolua_S,7,0.f));
- float a_SpeedZ = ((float) tolua_tonumber(tolua_S,8,0.f));
- {
- Lua__cPickup* tolua_ret = (Lua__cPickup*) Mtolua_new((Lua__cPickup)(a_MicroPosX,a_MicroPosY,a_MicroPosZ,*a_Item,a_SpeedX,a_SpeedY,a_SpeedZ));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Lua__cPickup");
- }
- }
- 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 Lua__cPickup */
-#ifndef TOLUA_DISABLE_tolua_AllToLua_Lua__cPickup_new00_local
-static int tolua_AllToLua_Lua__cPickup_new00_local(lua_State* tolua_S)
-{
-#ifndef TOLUA_RELEASE
- tolua_Error tolua_err;
- if (
- !tolua_isusertable(tolua_S,1,"Lua__cPickup",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_isvaluenil(tolua_S,5,&tolua_err) || !tolua_isusertype(tolua_S,5,"cItem",0,&tolua_err)) ||
- !tolua_isnumber(tolua_S,6,1,&tolua_err) ||
- !tolua_isnumber(tolua_S,7,1,&tolua_err) ||
- !tolua_isnumber(tolua_S,8,1,&tolua_err) ||
- !tolua_isnoobj(tolua_S,9,&tolua_err)
- )
- goto tolua_lerror;
- else
-#endif
- {
- int a_MicroPosX = ((int) tolua_tonumber(tolua_S,2,0));
- int a_MicroPosY = ((int) tolua_tonumber(tolua_S,3,0));
- int a_MicroPosZ = ((int) tolua_tonumber(tolua_S,4,0));
- const cItem* a_Item = ((const cItem*) tolua_tousertype(tolua_S,5,0));
- float a_SpeedX = ((float) tolua_tonumber(tolua_S,6,0.f));
- float a_SpeedY = ((float) tolua_tonumber(tolua_S,7,0.f));
- float a_SpeedZ = ((float) tolua_tonumber(tolua_S,8,0.f));
- {
- Lua__cPickup* tolua_ret = (Lua__cPickup*) Mtolua_new((Lua__cPickup)(a_MicroPosX,a_MicroPosY,a_MicroPosZ,*a_Item,a_SpeedX,a_SpeedY,a_SpeedZ));
- tolua_pushusertype(tolua_S,(void*)tolua_ret,"Lua__cPickup");
- 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
-
-
-/* function to release collected object via destructor */
-#ifdef __cplusplus
-
-static int tolua_collect_Lua__cPickup (lua_State* tolua_S)
-{
- Lua__cPickup* self = (Lua__cPickup*) tolua_tousertype(tolua_S,1,0);
- delete self;
- return 0;
-}
-#endif
-
/* get function: m_PrimaryServerVersion of class cRoot */
#ifndef TOLUA_DISABLE_tolua_get_cRoot_m_PrimaryServerVersion
static int tolua_get_cRoot_m_PrimaryServerVersion(lua_State* tolua_S)
@@ -28550,6 +26657,73 @@ static int tolua_AllToLua_cWindow_SetWindowTitle00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
+/* method: SetProperty of class cWindow */
+#ifndef TOLUA_DISABLE_tolua_AllToLua_cWindow_SetProperty00
+static int tolua_AllToLua_cWindow_SetProperty00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+ !tolua_isusertype(tolua_S,1,"cWindow",0,&tolua_err) ||
+ !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+ !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
+ !tolua_isnoobj(tolua_S,4,&tolua_err)
+ )
+ goto tolua_lerror;
+ else
+#endif
+ {
+ cWindow* self = (cWindow*) tolua_tousertype(tolua_S,1,0);
+ int a_Property = ((int) tolua_tonumber(tolua_S,2,0));
+ int a_Value = ((int) tolua_tonumber(tolua_S,3,0));
+#ifndef TOLUA_RELEASE
+ if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetProperty'", NULL);
+#endif
+ {
+ self->SetProperty(a_Property,a_Value);
+ }
+ }
+ return 0;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'SetProperty'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
+/* method: SetProperty of class cWindow */
+#ifndef TOLUA_DISABLE_tolua_AllToLua_cWindow_SetProperty01
+static int tolua_AllToLua_cWindow_SetProperty01(lua_State* tolua_S)
+{
+ tolua_Error tolua_err;
+ if (
+ !tolua_isusertype(tolua_S,1,"cWindow",0,&tolua_err) ||
+ !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
+ !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
+ (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"cPlayer",0,&tolua_err)) ||
+ !tolua_isnoobj(tolua_S,5,&tolua_err)
+ )
+ goto tolua_lerror;
+ else
+ {
+ cWindow* self = (cWindow*) tolua_tousertype(tolua_S,1,0);
+ int a_Property = ((int) tolua_tonumber(tolua_S,2,0));
+ int a_Value = ((int) tolua_tonumber(tolua_S,3,0));
+ cPlayer* a_Player = ((cPlayer*) tolua_tousertype(tolua_S,4,0));
+#ifndef TOLUA_RELEASE
+ if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetProperty'", NULL);
+#endif
+ {
+ self->SetProperty(a_Property,a_Value,*a_Player);
+ }
+ }
+ return 0;
+tolua_lerror:
+ return tolua_AllToLua_cWindow_SetProperty00(tolua_S);
+}
+#endif //#ifndef TOLUA_DISABLE
+
/* method: new of class cLuaWindow */
#ifndef TOLUA_DISABLE_tolua_AllToLua_cLuaWindow_new00
static int tolua_AllToLua_cLuaWindow_new00(lua_State* tolua_S)
@@ -29603,29 +27777,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"IsSprinting",tolua_AllToLua_cEntity_IsSprinting00);
tolua_function(tolua_S,"IsRclking",tolua_AllToLua_cEntity_IsRclking00);
tolua_endmodule(tolua_S);
- tolua_cclass(tolua_S,"Lua__cEntity","Lua__cEntity","cEntity",NULL);
- tolua_beginmodule(tolua_S,"Lua__cEntity");
- tolua_function(tolua_S,"tolua__set_instance",tolua_AllToLua_Lua__cEntity_tolua__set_instance00);
- tolua_function(tolua_S,"cEntity__IsA",tolua_AllToLua_Lua__cEntity_cEntity__IsA00);
- tolua_function(tolua_S,"cEntity__GetClass",tolua_AllToLua_Lua__cEntity_cEntity__GetClass00);
- tolua_function(tolua_S,"cEntity__GetParentClass",tolua_AllToLua_Lua__cEntity_cEntity__GetParentClass00);
- tolua_function(tolua_S,"cEntity__GetRawDamageAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetRawDamageAgainst00);
- tolua_function(tolua_S,"cEntity__GetArmorCoverAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetArmorCoverAgainst00);
- tolua_function(tolua_S,"cEntity__GetKnockbackAmountAgainst",tolua_AllToLua_Lua__cEntity_cEntity__GetKnockbackAmountAgainst00);
- tolua_function(tolua_S,"cEntity__GetEquippedWeapon",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedWeapon00);
- tolua_function(tolua_S,"cEntity__GetEquippedHelmet",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedHelmet00);
- tolua_function(tolua_S,"cEntity__GetEquippedChestplate",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedChestplate00);
- tolua_function(tolua_S,"cEntity__GetEquippedLeggings",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedLeggings00);
- tolua_function(tolua_S,"cEntity__GetEquippedBoots",tolua_AllToLua_Lua__cEntity_cEntity__GetEquippedBoots00);
- tolua_function(tolua_S,"cEntity__KilledBy",tolua_AllToLua_Lua__cEntity_cEntity__KilledBy00);
- tolua_function(tolua_S,"cEntity__TeleportToEntity",tolua_AllToLua_Lua__cEntity_cEntity__TeleportToEntity00);
- tolua_function(tolua_S,"cEntity__TeleportToCoords",tolua_AllToLua_Lua__cEntity_cEntity__TeleportToCoords00);
- tolua_function(tolua_S,"cEntity__IsOnFire",tolua_AllToLua_Lua__cEntity_cEntity__IsOnFire00);
- tolua_function(tolua_S,"cEntity__IsCrouched",tolua_AllToLua_Lua__cEntity_cEntity__IsCrouched00);
- tolua_function(tolua_S,"cEntity__IsRiding",tolua_AllToLua_Lua__cEntity_cEntity__IsRiding00);
- tolua_function(tolua_S,"cEntity__IsSprinting",tolua_AllToLua_Lua__cEntity_cEntity__IsSprinting00);
- tolua_function(tolua_S,"cEntity__IsRclking",tolua_AllToLua_Lua__cEntity_cEntity__IsRclking00);
- tolua_endmodule(tolua_S);
tolua_cclass(tolua_S,"cPawn","cPawn","cEntity",NULL);
tolua_beginmodule(tolua_S,"cPawn");
tolua_endmodule(tolua_S);
@@ -29695,13 +27846,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"IsSwimming",tolua_AllToLua_cPlayer_IsSwimming00);
tolua_function(tolua_S,"IsSubmerged",tolua_AllToLua_cPlayer_IsSubmerged00);
tolua_endmodule(tolua_S);
- tolua_cclass(tolua_S,"Lua__cPlayer","Lua__cPlayer","cPlayer",NULL);
- tolua_beginmodule(tolua_S,"Lua__cPlayer");
- tolua_function(tolua_S,"tolua__set_instance",tolua_AllToLua_Lua__cPlayer_tolua__set_instance00);
- tolua_function(tolua_S,"cPlayer__MoveTo",tolua_AllToLua_Lua__cPlayer_cPlayer__MoveTo00);
- tolua_function(tolua_S,"cPlayer__IsSwimming",tolua_AllToLua_Lua__cPlayer_cPlayer__IsSwimming00);
- tolua_function(tolua_S,"cPlayer__IsSubmerged",tolua_AllToLua_Lua__cPlayer_cPlayer__IsSubmerged00);
- tolua_endmodule(tolua_S);
tolua_cclass(tolua_S,"cPluginManager","cPluginManager","",NULL);
tolua_beginmodule(tolua_S,"cPluginManager");
tolua_constant(tolua_S,"HOOK_BLOCK_TO_PICKUPS",cPluginManager::HOOK_BLOCK_TO_PICKUPS);
@@ -30163,10 +28307,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"HandleWebRequest",tolua_AllToLua_cWebPlugin_HandleWebRequest00);
tolua_function(tolua_S,"SafeString",tolua_AllToLua_cWebPlugin_SafeString00);
tolua_endmodule(tolua_S);
- tolua_cclass(tolua_S,"Lua__cWebPlugin","Lua__cWebPlugin","cWebPlugin",NULL);
- tolua_beginmodule(tolua_S,"Lua__cWebPlugin");
- tolua_function(tolua_S,"tolua__set_instance",tolua_AllToLua_Lua__cWebPlugin_tolua__set_instance00);
- tolua_endmodule(tolua_S);
#ifdef __cplusplus
tolua_cclass(tolua_S,"cPickup","cPickup","cEntity",tolua_collect_cPickup);
#else
@@ -30179,18 +28319,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"GetItem",tolua_AllToLua_cPickup_GetItem00);
tolua_function(tolua_S,"CollectedBy",tolua_AllToLua_cPickup_CollectedBy00);
tolua_endmodule(tolua_S);
- #ifdef __cplusplus
- tolua_cclass(tolua_S,"Lua__cPickup","Lua__cPickup","cPickup",tolua_collect_Lua__cPickup);
- #else
- tolua_cclass(tolua_S,"Lua__cPickup","Lua__cPickup","cPickup",NULL);
- #endif
- tolua_beginmodule(tolua_S,"Lua__cPickup");
- tolua_function(tolua_S,"tolua__set_instance",tolua_AllToLua_Lua__cPickup_tolua__set_instance00);
- tolua_function(tolua_S,"cPickup__CollectedBy",tolua_AllToLua_Lua__cPickup_cPickup__CollectedBy00);
- tolua_function(tolua_S,"new",tolua_AllToLua_Lua__cPickup_new00);
- tolua_function(tolua_S,"new_local",tolua_AllToLua_Lua__cPickup_new00_local);
- tolua_function(tolua_S,".call",tolua_AllToLua_Lua__cPickup_new00_local);
- tolua_endmodule(tolua_S);
tolua_cclass(tolua_S,"cRoot","cRoot","",NULL);
tolua_beginmodule(tolua_S,"cRoot");
tolua_variable(tolua_S,"m_PrimaryServerVersion",tolua_get_cRoot_m_PrimaryServerVersion,tolua_set_cRoot_m_PrimaryServerVersion);
@@ -30549,6 +28677,8 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"IsSlotInPlayerInventory",tolua_AllToLua_cWindow_IsSlotInPlayerInventory00);
tolua_function(tolua_S,"GetWindowTitle",tolua_AllToLua_cWindow_GetWindowTitle00);
tolua_function(tolua_S,"SetWindowTitle",tolua_AllToLua_cWindow_SetWindowTitle00);
+ tolua_function(tolua_S,"SetProperty",tolua_AllToLua_cWindow_SetProperty00);
+ tolua_function(tolua_S,"SetProperty",tolua_AllToLua_cWindow_SetProperty01);
tolua_endmodule(tolua_S);
#ifdef __cplusplus
tolua_cclass(tolua_S,"cLuaWindow","cLuaWindow","cWindow",tolua_collect_cLuaWindow);
diff --git a/source/Bindings.h b/source/Bindings.h
index fdc3f39d9..a403294a9 100644
--- a/source/Bindings.h
+++ b/source/Bindings.h
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 08/17/13 23:54:30.
+** Generated automatically by tolua++-1.0.92 on 08/18/13 13:15:34.
*/
/* Exported function */
diff --git a/source/BlockEntities/FurnaceEntity.cpp b/source/BlockEntities/FurnaceEntity.cpp
index e1b6fc47b..6cac8573d 100644
--- a/source/BlockEntities/FurnaceEntity.cpp
+++ b/source/BlockEntities/FurnaceEntity.cpp
@@ -220,7 +220,7 @@ void cFurnaceEntity::BroadcastProgress(int a_ProgressbarID, short a_Value)
cWindow * Window = GetWindow();
if (Window != NULL)
{
- Window->BroadcastInventoryProgress(a_ProgressbarID, a_Value);
+ Window->BroadcastProgress(a_ProgressbarID, a_Value);
}
}
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index dce2bbd25..4372d052c 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -1718,15 +1718,6 @@ void cClientHandle::SendHealth(void)
-void cClientHandle::SendInventoryProgress(char a_WindowID, short a_ProgressBar, short a_Value)
-{
- m_Protocol->SendInventoryProgress(a_WindowID, a_ProgressBar, a_Value);
-}
-
-
-
-
-
void cClientHandle::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item)
{
m_Protocol->SendInventorySlot(a_WindowID, a_SlotNum, a_Item);
@@ -1954,36 +1945,45 @@ void cClientHandle::SendWeather(eWeather a_Weather)
-void cClientHandle::SendWindowClose(const cWindow & a_Window)
+void cClientHandle::SendWholeInventory(const cInventory & a_Inventory)
{
- m_Protocol->SendWindowClose(a_Window);
+ m_Protocol->SendWholeInventory(a_Inventory);
}
-void cClientHandle::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
+void cClientHandle::SendWholeInventory(const cWindow & a_Window)
{
- m_Protocol->SendWindowOpen(a_WindowID, a_WindowType, a_WindowTitle, a_NumSlots);
+ m_Protocol->SendWholeInventory(a_Window);
}
-void cClientHandle::SendWholeInventory(const cInventory & a_Inventory)
+void cClientHandle::SendWindowClose(const cWindow & a_Window)
{
- m_Protocol->SendWholeInventory(a_Inventory);
+ m_Protocol->SendWindowClose(a_Window);
}
-void cClientHandle::SendWholeInventory(const cWindow & a_Window)
+void cClientHandle::SendWindowOpen(char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots)
{
- m_Protocol->SendWholeInventory(a_Window);
+ m_Protocol->SendWindowOpen(a_WindowID, a_WindowType, a_WindowTitle, a_NumSlots);
+}
+
+
+
+
+
+void cClientHandle::SendWindowProperty(const cWindow & a_Window, int a_Property, int a_Value)
+{
+ m_Protocol->SendWindowProperty(a_Window, a_Property, a_Value);
}
diff --git a/source/ClientHandle.h b/source/ClientHandle.h
index 9454b9b7a..c85257df1 100644
--- a/source/ClientHandle.h
+++ b/source/ClientHandle.h
@@ -111,7 +111,6 @@ public:
void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion);
void SendGameMode (eGameMode a_GameMode);
void SendHealth (void);
- void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value);
void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item);
void SendPickupSpawn (const cPickup & a_Pickup);
void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation);
@@ -139,6 +138,7 @@ public:
void SendWholeInventory (const cWindow & a_Window);
void SendWindowClose (const cWindow & a_Window);
void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots);
+ void SendWindowProperty (const cWindow & a_Window, int a_Property, int a_Value);
const AString & GetUsername(void) const; // tolua_export
void SetUsername( const AString & a_Username ); // tolua_export
diff --git a/source/OSSupport/ListenThread.cpp b/source/OSSupport/ListenThread.cpp
index 4542326ef..c586227df 100644
--- a/source/OSSupport/ListenThread.cpp
+++ b/source/OSSupport/ListenThread.cpp
@@ -25,7 +25,7 @@ cListenThread::cListenThread(cCallback & a_Callback, cSocket::eFamily a_Family,
cListenThread::~cListenThread()
{
- // TODO
+ Stop();
}
@@ -79,7 +79,11 @@ void cListenThread::Stop(void)
// Wait for the thread to finish
super::Wait();
- // Clean up all sockets
+ // Close all the listening sockets:
+ for (cSockets::iterator itr = m_Sockets.begin(), end = m_Sockets.end(); itr != end; ++itr)
+ {
+ itr->CloseSocket();
+ } // for itr - m_Sockets[]
m_Sockets.clear();
}
diff --git a/source/Piston.cpp b/source/Piston.cpp
index f83eb016d..175cfc19a 100644
--- a/source/Piston.cpp
+++ b/source/Piston.cpp
@@ -20,21 +20,6 @@ extern bool g_BlockPistonBreakable[];
-//Replace AddDir (...) with the switch cases that, sets coords in direction of piston face
-#define AddDir( x, y, z, dir, amount ) \
- switch (dir) \
- { \
- case 0: (y)-=(amount); break; \
- case 1: (y)+=(amount); break; \
- case 2: (z)-=(amount); break; \
- case 3: (z)+=(amount); break; \
- case 4: (x)-=(amount); break; \
- case 5: (x)+=(amount); break; \
- }
-
-
-
-
cPiston::cPiston(cWorld * a_World)
: m_World(a_World)
@@ -46,66 +31,55 @@ cPiston::cPiston(cWorld * a_World)
-unsigned short cPiston::FirstPassthroughBlock(int pistonX, int pistonY, int pistonZ, char pistonmeta)
+int cPiston::FirstPassthroughBlock(int pistonX, int pistonY, int pistonZ, NIBBLETYPE pistonmeta)
{
- unsigned short ret;
- pistonmeta &= 7;
- if (pistonmeta >= 6)
- {
- // Just in case, it shouldn't happen but if it would, it'd cause inf loop
- LOGD("cPiston::FirstPassthroughBlock - piston has invalid meta data!\n");
- return 9001;
- }
- BLOCKTYPE currBlock;
- NIBBLETYPE currMeta;
- for (ret = 0; ret < 24; ret++) //Push up to 24 blocks
+ // Examine each of the 12 blocks ahead of the piston:
+ for (int ret = 0; ret < 12; ret++)
{
- AddDir( pistonX, pistonY, pistonZ, pistonmeta, 1) //Set the coords one further from the piston direction
+ BLOCKTYPE currBlock;
+ NIBBLETYPE currMeta;
+ AddDir(pistonX, pistonY, pistonZ, pistonmeta, 1);
m_World->GetBlockTypeMeta(pistonX, pistonY, pistonZ, currBlock, currMeta);
- if ((currBlock == E_BLOCK_BEDROCK) ||
- (currBlock == E_BLOCK_OBSIDIAN) ||
- (currBlock == E_BLOCK_PISTON_EXTENSION) ||
- ( (currMeta & 0x8) != 0x0 ) || //Seems to include signs as well
- (currBlock == E_BLOCK_CHEST) ||
- (currBlock == E_BLOCK_DISPENSER) ||
- (currBlock == E_BLOCK_DROPPER) ||
- (currBlock == E_BLOCK_FURNACE) ||
- (currBlock == E_BLOCK_LIT_FURNACE) ||
- (currBlock == E_BLOCK_HOPPER) ||
- (currBlock == E_BLOCK_JUKEBOX) ||
- (currBlock == E_BLOCK_NOTE_BLOCK))
+ if (CanBreakPush(currBlock, currMeta))
{
- return 9001;
+ // This block breaks when pushed, extend up to here
+ return ret;
}
- if (g_BlockPistonBreakable[currBlock]) //If it's a breakable block (air, torch, etc.) then the line of blocks can be pushed
+ if (!CanPush(currBlock, currMeta))
{
- return ret;
+ // This block cannot be pushed at all, the piston can't extend
+ return -1;
}
}
- return 9001; //There is no space for the blocks to move within 24 spaces, piston can't push
+ // There is no space for the blocks to move, piston can't extend
+ return -1;
}
-void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
+void cPiston::ExtendPiston(int pistx, int pisty, int pistz)
{
BLOCKTYPE pistonBlock;
NIBBLETYPE pistonMeta;
m_World->GetBlockTypeMeta(pistx, pisty, pistz, pistonBlock, pistonMeta);
- char isSticky = (char)(pistonBlock == E_BLOCK_STICKY_PISTON) * 8;
- if ( (pistonMeta & 0x8) != 0x0 )
+ if (IsExtended(pistonMeta))
{
- // Piston already extended, bail out
+ // Already extended, bail out
return;
}
- unsigned short dist = FirstPassthroughBlock(pistx, pisty, pistz, pistonMeta);
- if (dist > 9000) return; // FirstPassthroughBlock says piston can't push anything, bail out
+ int dist = FirstPassthroughBlock(pistx, pisty, pistz, pistonMeta);
+ if (dist < 0)
+ {
+ // FirstPassthroughBlock says piston can't push anything, bail out
+ return;
+ }
- AddDir(pistx, pisty, pistz, pistonMeta & 7, dist + 1) //Get the coords of the air / breakable block in the line, dist+1 because of coords
+ // Drop the breakable block in the line, if appropriate:
+ AddDir(pistx, pisty, pistz, pistonMeta, dist + 1); // "pist" now at the breakable / empty block
BLOCKTYPE currBlock;
NIBBLETYPE currMeta;
m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currMeta);
@@ -117,27 +91,26 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
Handler->DropBlock(m_World, NULL, pistx, pisty, pistz); //If block is breakable, drop it
}
}
- int oldx = pistx, oldy = pisty, oldz = pistz; //Make a second set of coord vars along with the originals
+
+ // Push blocks, from the furthest to the nearest:
+ int oldx = pistx, oldy = pisty, oldz = pistz;
NIBBLETYPE currBlockMeta;
- if (dist != 0) //Check for single block being pushed - for loop doesn't catch it in time and breaks stuffz
+ for (int i = dist + 1; i > 1; i--)
{
- for (int i = dist + 1; i > 1; i--) //Decrement from the dropped breakable block to two further than the piston (one further will be future extension)
- {
- AddDir(pistx, pisty, pistz, pistonMeta & 7, -1) //Move one set of coords one back from breakable dropped block
- m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currBlockMeta); //Get the block
- m_World->SetServerBlock( oldx, oldy, oldz, currBlock, currBlockMeta); //Set the block at the location of the original coords
- oldx = pistx; //Shift the selectors down a block and repeat
- oldy = pisty;
- oldz = pistz;
- }
+ AddDir(pistx, pisty, pistz, pistonMeta, -1);
+ m_World->GetBlockTypeMeta(pistx, pisty, pistz, currBlock, currBlockMeta);
+ m_World->SetServerBlock( oldx, oldy, oldz, currBlock, currBlockMeta);
+ oldx = pistx;
+ oldy = pisty;
+ oldz = pistz;
}
int extx = pistx;
int exty = pisty;
int extz = pistz;
-
- AddDir(pistx, pisty, pistz, pistonMeta & 7, -1) //Move back one block to the piston base
-
+ AddDir(pistx, pisty, pistz, pistonMeta, -1);
+ // "pist" now at piston body, "ext" at future extension
+
if (pistonBlock == E_BLOCK_STICKY_PISTON)
{
m_World->BroadcastBlockAction(pistx, pisty, pistz, 0, pistonMeta, E_BLOCK_STICKY_PISTON);
@@ -148,8 +121,9 @@ void cPiston::ExtendPiston( int pistx, int pisty, int pistz )
}
m_World->BroadcastSoundEffect("tile.piston.out", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f);
- m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 ); //Set the base
- m_World->SetServerBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta); //Set the arm
+ m_World->FastSetBlock( pistx, pisty, pistz, pistonBlock, pistonMeta | 0x8 );
+ m_World->SetServerBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta);
+
}
@@ -161,7 +135,7 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
BLOCKTYPE pistonBlock;
NIBBLETYPE pistonMeta;
m_World->GetBlockTypeMeta(pistx, pisty, pistz, pistonBlock, pistonMeta);
- if (pistonMeta <= 6)
+ if (!IsExtended(pistonMeta))
{
// Already retracted, bail out
return;
@@ -177,45 +151,34 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
}
m_World->BroadcastSoundEffect("tile.piston.in", pistx * 8, pisty * 8, pistz * 8, 0.5f, 0.7f);
- m_World->SetServerBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8)); //Set the base
+ m_World->SetServerBlock(pistx, pisty, pistz, pistonBlock, pistonMeta & ~(8));
- AddDir(pistx, pisty, pistz, pistonMeta & 7, 1) //Move forwards to the extension coord
+
+ // Check the extension:
+ AddDir(pistx, pisty, pistz, pistonMeta, 1);
if (m_World->GetBlock(pistx, pisty, pistz) != E_BLOCK_PISTON_EXTENSION)
{
LOGD("%s: Piston without an extension?", __FUNCTION__);
return;
}
- if (pistonBlock == E_BLOCK_STICKY_PISTON)
+ // Retract the extension, pull block if appropriate
+ if (IsSticky(pistonBlock))
{
int tempx = pistx, tempy = pisty, tempz = pistz;
- AddDir( tempx, tempy, tempz, pistonMeta & 7, 1 ) //Move forward to the block being pulled
- BLOCKTYPE tempblock;
- NIBBLETYPE tempmeta;
- m_World->GetBlockTypeMeta(tempx, tempy, tempz, tempblock, tempmeta); //Check for pullable-ness
- if (
- (tempblock == E_BLOCK_OBSIDIAN) ||
- (tempblock == E_BLOCK_BEDROCK) ||
- (tempblock == E_BLOCK_PISTON_EXTENSION) ||
- (g_BlockPistonBreakable[tempblock]) ||
- ( (tempmeta & 0x8) != 0x0 ) || //Seems to include signs as well
- (tempblock == E_BLOCK_CHEST) ||
- (tempblock == E_BLOCK_DISPENSER) ||
- (tempblock == E_BLOCK_DROPPER) ||
- (tempblock == E_BLOCK_FURNACE) ||
- (tempblock == E_BLOCK_LIT_FURNACE) ||
- (tempblock == E_BLOCK_HOPPER) ||
- (tempblock == E_BLOCK_JUKEBOX) ||
- (tempblock == E_BLOCK_NOTE_BLOCK)
- )
+ AddDir( tempx, tempy, tempz, pistonMeta, 1);
+ BLOCKTYPE tempBlock;
+ NIBBLETYPE tempMeta;
+ m_World->GetBlockTypeMeta(tempx, tempy, tempz, tempBlock, tempMeta);
+ if (CanPull(tempBlock, tempMeta))
+ {
+ m_World->SetServerBlock(pistx, pisty, pistz, tempBlock, tempMeta);
+ m_World->SetServerBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0);
+ }
+ else
{
- // These cannot be moved by the sticky piston, bail out
m_World->SetServerBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0);
- return;
}
-
- m_World->SetServerBlock(pistx, pisty, pistz, tempblock, tempmeta);
- m_World->SetServerBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0);
}
else
{
@@ -226,3 +189,120 @@ void cPiston::RetractPiston( int pistx, int pisty, int pistz )
+
+bool cPiston::IsExtended(NIBBLETYPE a_PistonMeta)
+{
+ return ((a_PistonMeta & 0x8) != 0x0);
+}
+
+
+
+
+
+bool cPiston::IsSticky(BLOCKTYPE a_BlockType)
+{
+ return (a_BlockType == E_BLOCK_STICKY_PISTON);
+}
+
+
+
+
+
+bool cPiston::IsStickyExtension(NIBBLETYPE a_ExtMeta)
+{
+ return ((a_ExtMeta & 0x08) != 0);
+}
+
+
+
+
+
+bool cPiston::CanPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+ switch (a_BlockType)
+ {
+ case E_BLOCK_ANVIL:
+ case E_BLOCK_BED:
+ case E_BLOCK_BEDROCK:
+ case E_BLOCK_BREWING_STAND:
+ case E_BLOCK_CHEST:
+ case E_BLOCK_COMMAND_BLOCK:
+ case E_BLOCK_DISPENSER:
+ case E_BLOCK_DROPPER:
+ case E_BLOCK_ENCHANTMENT_TABLE:
+ case E_BLOCK_END_PORTAL:
+ case E_BLOCK_END_PORTAL_FRAME:
+ case E_BLOCK_FURNACE:
+ case E_BLOCK_LIT_FURNACE:
+ case E_BLOCK_HOPPER:
+ case E_BLOCK_JUKEBOX:
+ case E_BLOCK_MOB_SPAWNER:
+ case E_BLOCK_NETHER_PORTAL:
+ case E_BLOCK_NOTE_BLOCK:
+ case E_BLOCK_OBSIDIAN:
+ case E_BLOCK_PISTON_EXTENSION:
+ {
+ return false;
+ }
+ case E_BLOCK_PISTON:
+ {
+ // A piston can only be pushed if retracted:
+ return !IsExtended(a_BlockMeta);
+ }
+ }
+ return true;
+}
+
+
+
+
+
+bool cPiston::CanBreakPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+ return g_BlockPistonBreakable[a_BlockType];
+}
+
+
+
+
+
+bool cPiston::CanPull(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+{
+ switch (a_BlockType)
+ {
+ case E_BLOCK_LAVA:
+ case E_BLOCK_STATIONARY_LAVA:
+ case E_BLOCK_STATIONARY_WATER:
+ case E_BLOCK_WATER:
+ {
+ return false;
+ }
+ }
+ return CanPush(a_BlockType, a_BlockMeta) || CanBreakPush(a_BlockType, a_BlockMeta);
+}
+
+
+
+
+
+void cPiston::AddDir(int & a_BlockX, int & a_BlockY, int & a_BlockZ, NIBBLETYPE a_PistonMeta, int a_Amount)
+{
+ switch (a_PistonMeta & 0x07)
+ {
+ case 0: a_BlockY -= a_Amount; break;
+ case 1: a_BlockY += a_Amount; break;
+ case 2: a_BlockZ -= a_Amount; break;
+ case 3: a_BlockZ += a_Amount; break;
+ case 4: a_BlockX -= a_Amount; break;
+ case 5: a_BlockX += a_Amount; break;
+ default:
+ {
+ LOGWARNING("%s: invalid direction %d, ignoring", __FUNCTION__, a_PistonMeta & 0x07);
+ break;
+ }
+ }
+}
+
+
+
+
diff --git a/source/Piston.h b/source/Piston.h
index 67aa80d67..cc051e454 100644
--- a/source/Piston.h
+++ b/source/Piston.h
@@ -57,12 +57,36 @@ public:
void ExtendPiston( int, int, int );
void RetractPiston( int, int, int );
-
+
+ /// Returns true if the piston (specified by blocktype) is a sticky piston
+ static bool IsSticky(BLOCKTYPE a_BlockType);
+
+ /// Returns true if the piston (with the specified meta) is extended
+ static bool IsExtended(NIBBLETYPE a_PistonMeta);
+
+ /// Returns true if the extension (with the specified meta) is sticky
+ static bool IsStickyExtension(NIBBLETYPE a_ExtMeta);
+
+ /// Returns true if the specified block can be pushed by a piston (and left intact)
+ static bool CanPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+
+ /// Returns true if the specified block can be pushed by a piston and broken / replaced
+ static bool CanBreakPush(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+
+ /// Returns true if the specified block can be pulled by a sticky piston
+ static bool CanPull(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+
+ /// Updates the coords by the specified amount in the direction a piston of the specified meta is facing
+ static void AddDir(int & a_BlockX, int & a_BlockY, int & a_BlockZ, NIBBLETYPE a_PistonMeta, int a_Amount);
+
+
cWorld * m_World;
private:
void ChainMove( int, int, int, char, unsigned short * );
- unsigned short FirstPassthroughBlock( int, int, int, char );
+
+ /// Returns how many blocks the piston has to push (where the first free space is); <0 when unpushable
+ int FirstPassthroughBlock(int a_PistonX, int a_PistonY, int a_PistonZ, NIBBLETYPE a_PistonMeta);
} ;
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h
index 5c46b2726..0953071b1 100644
--- a/source/Protocol/Protocol.h
+++ b/source/Protocol/Protocol.h
@@ -73,7 +73,6 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) = 0;
virtual void SendGameMode (eGameMode a_GameMode) = 0;
virtual void SendHealth (void) = 0;
- virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) = 0;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) = 0;
virtual void SendKeepAlive (int a_PingID) = 0;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) = 0;
@@ -103,6 +102,7 @@ public:
virtual void SendWholeInventory (const cWindow & a_Window) = 0;
virtual void SendWindowClose (const cWindow & a_Window) = 0;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) = 0;
+ virtual void SendWindowProperty (const cWindow & a_Window, short a_Property, short a_Value) = 0;
/// Returns the ServerID used for authentication through session.minecraft.net
virtual AString GetAuthServerID(void) = 0;
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index e481bb9a7..6f79ed12c 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -82,7 +82,7 @@ enum
PACKET_WINDOW_CLICK = 0x66,
PACKET_INVENTORY_SLOT = 0x67,
PACKET_INVENTORY_WHOLE = 0x68,
- PACKET_INVENTORY_PROGRESS = 0x69,
+ PACKET_WINDOW_PROPERTY = 0x69,
PACKET_CREATIVE_INVENTORY_ACTION = 0x6B,
PACKET_UPDATE_SIGN = 0x82,
PACKET_PLAYER_LIST_ITEM = 0xC9,
@@ -491,20 +491,6 @@ void cProtocol125::SendHealth(void)
-void cProtocol125::SendInventoryProgress(char a_WindowID, short a_ProgressBar, short a_Value)
-{
- cCSLock Lock(m_CSPacket);
- WriteByte (PACKET_INVENTORY_PROGRESS);
- WriteByte (a_WindowID);
- WriteShort(a_ProgressBar);
- WriteShort(a_Value);
- Flush();
-}
-
-
-
-
-
void cProtocol125::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item)
{
cCSLock Lock(m_CSPacket);
@@ -975,6 +961,20 @@ void cProtocol125::SendWindowOpen(char a_WindowID, char a_WindowType, const AStr
+void cProtocol125::SendWindowProperty(const cWindow & a_Window, short a_Property, short a_Value)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte (PACKET_WINDOW_PROPERTY);
+ WriteByte (a_Window.GetWindowID());
+ WriteShort(a_Property);
+ WriteShort(a_Value);
+ Flush();
+}
+
+
+
+
+
AString cProtocol125::GetAuthServerID(void)
{
// http://wiki.vg/wiki/index.php?title=Session&oldid=2262
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h
index ee8fd94eb..ec6e12a0d 100644
--- a/source/Protocol/Protocol125.h
+++ b/source/Protocol/Protocol125.h
@@ -50,7 +50,6 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
- virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) override;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) override;
virtual void SendKeepAlive (int a_PingID) override;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
@@ -80,6 +79,7 @@ public:
virtual void SendWholeInventory (const cWindow & a_Window) override;
virtual void SendWindowClose (const cWindow & a_Window) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;
+ virtual void SendWindowProperty (const cWindow & a_Window, short a_Property, short a_Value) override;
virtual AString GetAuthServerID(void) override;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp
index 35c8fe993..ef2ed91f6 100644
--- a/source/Protocol/ProtocolRecognizer.cpp
+++ b/source/Protocol/ProtocolRecognizer.cpp
@@ -332,10 +332,10 @@ void cProtocolRecognizer::SendHealth(void)
-void cProtocolRecognizer::SendInventoryProgress(char a_WindowID, short a_Progressbar, short a_Value)
+void cProtocolRecognizer::SendWindowProperty(const cWindow & a_Window, short a_Property, short a_Value)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendInventoryProgress(a_WindowID, a_Progressbar, a_Value);
+ m_Protocol->SendWindowProperty(a_Window, a_Property, a_Value);
}
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h
index 43d4a15e2..94bbb184f 100644
--- a/source/Protocol/ProtocolRecognizer.h
+++ b/source/Protocol/ProtocolRecognizer.h
@@ -80,7 +80,6 @@ public:
virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
- virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) override;
virtual void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item) override;
virtual void SendKeepAlive (int a_PingID) override;
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
@@ -110,6 +109,7 @@ public:
virtual void SendWholeInventory (const cWindow & a_Window) override;
virtual void SendWindowClose (const cWindow & a_Window) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;
+ virtual void SendWindowProperty (const cWindow & a_Window, short a_Property, short a_Value) override;
virtual AString GetAuthServerID(void) override;
diff --git a/source/UI/Window.cpp b/source/UI/Window.cpp
index 415ce08ff..786ae6ed1 100644
--- a/source/UI/Window.cpp
+++ b/source/UI/Window.cpp
@@ -664,12 +664,12 @@ void cWindow::BroadcastWholeWindow(void)
-void cWindow::BroadcastInventoryProgress(short a_Progressbar, short a_Value)
+void cWindow::BroadcastProgress(int a_Progressbar, int a_Value)
{
cCSLock Lock(m_CS);
for (cPlayerList::iterator itr = m_OpenedBy.begin(); itr != m_OpenedBy.end(); ++itr)
{
- (*itr)->GetClientHandle()->SendInventoryProgress(m_WindowID, a_Progressbar, a_Value);
+ (*itr)->GetClientHandle()->SendWindowProperty(*this, a_Progressbar, a_Value);
} // for itr - m_OpenedBy[]
}
@@ -677,6 +677,28 @@ void cWindow::BroadcastInventoryProgress(short a_Progressbar, short a_Value)
+void cWindow::SetProperty(int a_Property, int a_Value)
+{
+ cCSLock Lock(m_CS);
+ for (cPlayerList::iterator itr = m_OpenedBy.begin(), end = m_OpenedBy.end(); itr != end; ++itr)
+ {
+ (*itr)->GetClientHandle()->SendWindowProperty(*this, a_Property, a_Value);
+ } // for itr - m_OpenedBy[]
+}
+
+
+
+
+
+void cWindow::SetProperty(int a_Property, int a_Value, cPlayer & a_Player)
+{
+ a_Player.GetClientHandle()->SendWindowProperty(*this, a_Property, a_Value);
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cInventoryWindow:
diff --git a/source/UI/Window.h b/source/UI/Window.h
index 0be43e819..aa7e9d0d0 100644
--- a/source/UI/Window.h
+++ b/source/UI/Window.h
@@ -120,14 +120,20 @@ public:
/// Sends the contents of the whole window to all clients of this window.
void BroadcastWholeWindow(void);
- /// Sends the progressbar to all clients of this window
- void BroadcastInventoryProgress(short a_Progressbar, short a_Value);
+ /// Sends the progressbar to all clients of this window (same as SetProperty)
+ void BroadcastProgress(int a_Progressbar, int a_Value);
// tolua_begin
const AString & GetWindowTitle() const { return m_WindowTitle; }
void SetWindowTitle(const AString & a_WindowTitle ) { m_WindowTitle = a_WindowTitle; }
+ /// Sends the UpdateWindowProperty (0x69) packet to all clients of the window
+ void SetProperty(int a_Property, int a_Value);
+
+ /// Sends the UpdateWindowPropert(0x69) packet to the specified player
+ void SetProperty(int a_Property, int a_Value, cPlayer & a_Player);
+
// tolua_end
void OwnerDestroyed(void);
diff --git a/source/virtual_method_hooks.lua b/source/virtual_method_hooks.lua
index b6cbe8268..15ff1d7f8 100644
--- a/source/virtual_method_hooks.lua
+++ b/source/virtual_method_hooks.lua
@@ -1,5 +1,5 @@
-- flags
-local disable_virtual_hooks = false
+local disable_virtual_hooks = true
local enable_pure_virtual = true
local default_private_access = false