summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-23 23:09:13 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-23 23:09:13 +0200
commit3953277568e67c37c705cca70517c446029c2fda (patch)
treeee05df68fd3037a1c42f43aae7e8473276b1b2ec
parentSource files cleanup: Mobs-related files in a separate subfolder, renamed. (diff)
downloadcuberite-3953277568e67c37c705cca70517c446029c2fda.tar
cuberite-3953277568e67c37c705cca70517c446029c2fda.tar.gz
cuberite-3953277568e67c37c705cca70517c446029c2fda.tar.bz2
cuberite-3953277568e67c37c705cca70517c446029c2fda.tar.lz
cuberite-3953277568e67c37c705cca70517c446029c2fda.tar.xz
cuberite-3953277568e67c37c705cca70517c446029c2fda.tar.zst
cuberite-3953277568e67c37c705cca70517c446029c2fda.zip
-rw-r--r--VC2008/MCServer.vcproj8
-rw-r--r--source/Bindings.cpp40
-rw-r--r--source/Bindings.h2
-rw-r--r--source/cBlockToPickup.cpp9
-rw-r--r--source/cBlockToPickup.h27
-rw-r--r--source/cChunk.cpp79
-rw-r--r--source/cClientHandle.cpp1
-rw-r--r--source/cDoors.h1
-rw-r--r--source/cPiston.cpp1
-rw-r--r--source/cWorld.cpp1
10 files changed, 36 insertions, 133 deletions
diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj
index 18a9378d0..66e2e457b 100644
--- a/VC2008/MCServer.vcproj
+++ b/VC2008/MCServer.vcproj
@@ -936,14 +936,6 @@
>
</File>
<File
- RelativePath="..\source\cBlockToPickup.cpp"
- >
- </File>
- <File
- RelativePath="..\source\cBlockToPickup.h"
- >
- </File>
- <File
RelativePath="..\source\cChestEntity.cpp"
>
</File>
diff --git a/source/Bindings.cpp b/source/Bindings.cpp
index 3684a540f..b04902383 100644
--- a/source/Bindings.cpp
+++ b/source/Bindings.cpp
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 09/08/12 22:43:41.
+** Generated automatically by tolua++-1.0.92 on 09/23/12 23:08:35.
*/
#ifndef __cplusplus
@@ -2655,6 +2655,35 @@ static int tolua_AllToLua_ItemTypeToString00(lua_State* tolua_S)
}
#endif //#ifndef TOLUA_DISABLE
+/* function: ItemToFullString */
+#ifndef TOLUA_DISABLE_tolua_AllToLua_ItemToFullString00
+static int tolua_AllToLua_ItemToFullString00(lua_State* tolua_S)
+{
+#ifndef TOLUA_RELEASE
+ tolua_Error tolua_err;
+ if (
+ (tolua_isvaluenil(tolua_S,1,&tolua_err) || !tolua_isusertype(tolua_S,1,"const cItem",0,&tolua_err)) ||
+ !tolua_isnoobj(tolua_S,2,&tolua_err)
+ )
+ goto tolua_lerror;
+ else
+#endif
+ {
+ const cItem* a_Item = ((const cItem*) tolua_tousertype(tolua_S,1,0));
+ {
+ AString tolua_ret = (AString) ItemToFullString(*a_Item);
+ tolua_pushcppstring(tolua_S,(const char*)tolua_ret);
+ }
+ }
+ return 1;
+#ifndef TOLUA_RELEASE
+ tolua_lerror:
+ tolua_error(tolua_S,"#ferror in function 'ItemToFullString'.",&tolua_err);
+ return 0;
+#endif
+}
+#endif //#ifndef TOLUA_DISABLE
+
/* get function: g_BlockLightValue */
#ifndef TOLUA_DISABLE_tolua_get_AllToLua_g_BlockLightValue
static int tolua_get_AllToLua_g_BlockLightValue(lua_State* tolua_S)
@@ -12841,12 +12870,12 @@ static int tolua_AllToLua_cInventory_GetFromHotBar00(lua_State* tolua_S)
#endif
{
cInventory* self = (cInventory*) tolua_tousertype(tolua_S,1,0);
- int a_SlotNum = ((int) tolua_tonumber(tolua_S,2,0));
+ int a_HotBarSlotNum = ((int) tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetFromHotBar'", NULL);
#endif
{
- cItem* tolua_ret = (cItem*) self->GetFromHotBar(a_SlotNum);
+ cItem* tolua_ret = (cItem*) self->GetFromHotBar(a_HotBarSlotNum);
tolua_pushusertype(tolua_S,(void*)tolua_ret,"cItem");
}
}
@@ -13573,7 +13602,7 @@ static int tolua_AllToLua_cChestEntity_SetSlot00(lua_State* tolua_S)
if (
!tolua_isusertype(tolua_S,1,"cChestEntity",0,&tolua_err) ||
!tolua_isnumber(tolua_S,2,0,&tolua_err) ||
- (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"cItem",0,&tolua_err)) ||
+ (tolua_isvaluenil(tolua_S,3,&tolua_err) || !tolua_isusertype(tolua_S,3,"const cItem",0,&tolua_err)) ||
!tolua_isnoobj(tolua_S,4,&tolua_err)
)
goto tolua_lerror;
@@ -13582,7 +13611,7 @@ static int tolua_AllToLua_cChestEntity_SetSlot00(lua_State* tolua_S)
{
cChestEntity* self = (cChestEntity*) tolua_tousertype(tolua_S,1,0);
int a_Slot = ((int) tolua_tonumber(tolua_S,2,0));
- cItem* a_Item = ((cItem*) tolua_tousertype(tolua_S,3,0));
+ const cItem* a_Item = ((const cItem*) tolua_tousertype(tolua_S,3,0));
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetSlot'", NULL);
#endif
@@ -21547,6 +21576,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_function(tolua_S,"StringToItem",tolua_AllToLua_StringToItem00);
tolua_function(tolua_S,"ItemToString",tolua_AllToLua_ItemToString00);
tolua_function(tolua_S,"ItemTypeToString",tolua_AllToLua_ItemTypeToString00);
+ tolua_function(tolua_S,"ItemToFullString",tolua_AllToLua_ItemToFullString00);
tolua_array(tolua_S,"g_BlockLightValue",tolua_get_AllToLua_g_BlockLightValue,tolua_set_AllToLua_g_BlockLightValue);
tolua_array(tolua_S,"g_BlockSpreadLightFalloff",tolua_get_AllToLua_g_BlockSpreadLightFalloff,tolua_set_AllToLua_g_BlockSpreadLightFalloff);
tolua_array(tolua_S,"g_BlockTransparent",tolua_get_AllToLua_g_BlockTransparent,tolua_set_AllToLua_g_BlockTransparent);
diff --git a/source/Bindings.h b/source/Bindings.h
index d75eff766..3cae96ba9 100644
--- a/source/Bindings.h
+++ b/source/Bindings.h
@@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
-** Generated automatically by tolua++-1.0.92 on 09/08/12 22:43:41.
+** Generated automatically by tolua++-1.0.92 on 09/23/12 23:08:36.
*/
/* Exported function */
diff --git a/source/cBlockToPickup.cpp b/source/cBlockToPickup.cpp
deleted file mode 100644
index add34dfcf..000000000
--- a/source/cBlockToPickup.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-
-#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
-
-#include "cBlockToPickup.h"
-#include "Defines.h"
-#include "BlockID.h"
-#include "MersenneTwister.h"
-
-
diff --git a/source/cBlockToPickup.h b/source/cBlockToPickup.h
deleted file mode 100644
index 1f4759c99..000000000
--- a/source/cBlockToPickup.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-#ifndef _WIN32
- #include "BlockID.h"
-#else
- enum ENUM_ITEM_ID;
-#endif
-
-#include "cItem.h"
-
-
-
-
-
-class cBlockToPickup // tolua_export
-{ // tolua_export
-public:
- /// For a given block and tool, returns the list of drops generated
-
- /// Returns true if the tool used for the block is the right one for the job. cClientHandle uses this to determine whether to decrease tool durability twice as much
- static bool IsRightTool(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, ENUM_ITEM_ID a_UsedTool); // tolua_export
-
-}; // tolua_export
-
-
-
-
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index 7f9c4838c..d2d680794 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -25,7 +25,6 @@
#include "cItem.h"
#include "cNoise.h"
#include "cRoot.h"
-#include "cBlockToPickup.h"
#include "MersenneTwister.h"
#include "cPlayer.h"
#include "BlockArea.h"
@@ -440,84 +439,6 @@ void cChunk::CheckBlocks(void)
m_World->SetBlock(WorldPos.x, WorldPos.y, WorldPos.z, E_BLOCK_AIR, 0);
}
-
- /*
- BLOCKTYPE BlockType = GetBlock(index);
- NIBBLETYPE BlockMeta = GetMeta (index);
- switch (BlockType)
- {
- // Stuff that drops when block below is destroyed:
- case E_BLOCK_REDSTONE_REPEATER_OFF:
- case E_BLOCK_REDSTONE_REPEATER_ON:
- case E_BLOCK_REDSTONE_WIRE:
- case E_BLOCK_CACTUS:
- case E_BLOCK_REEDS:
- case E_BLOCK_WOODEN_PRESSURE_PLATE:
- case E_BLOCK_STONE_PRESSURE_PLATE:
- case E_BLOCK_MINECART_TRACKS:
- case E_BLOCK_SIGN_POST:
- case E_BLOCK_CROPS:
- case E_BLOCK_SAPLING:
- case E_BLOCK_YELLOW_FLOWER:
- case E_BLOCK_RED_ROSE:
- case E_BLOCK_RED_MUSHROOM:
- case E_BLOCK_BROWN_MUSHROOM:
- case E_BLOCK_SNOW:
- {
- if (GetBlock(BlockPos.x, BlockPos.y - 1, BlockPos.z) == E_BLOCK_AIR)
- {
- SetBlock( BlockPos, E_BLOCK_AIR, 0 );
-
- Vector3i WorldPos = PositionToWorldPosition( BlockPos );
-
- m_World->GetSimulatorManager()->WakeUp(WorldPos.x, WorldPos.y, WorldPos.z);
-
- cItems Pickups;
- cBlockToPickup::ToPickup(BlockType, BlockMeta, E_ITEM_EMPTY, Pickups);
- m_World->SpawnItemPickups(Pickups, WorldPos.x, WorldPos.y, WorldPos.z);
- }
- break;
- }
-
- case E_BLOCK_REDSTONE_TORCH_OFF:
- case E_BLOCK_REDSTONE_TORCH_ON:
- case E_BLOCK_TORCH:
- {
- char Dir = cTorch::MetaDataToDirection( GetNibble( m_BlockMeta, BlockPos ) );
- Vector3i WorldPos = PositionToWorldPosition( BlockPos );
-
- Vector3i AttachedTo = WorldPos;
- AddDirection( AttachedTo.x, AttachedTo.y, AttachedTo.z, Dir, true );
- if( m_World->GetBlock( AttachedTo ) == E_BLOCK_AIR )
- {
- SetBlock( BlockPos, E_BLOCK_AIR, 0 );
-
- m_World->GetSimulatorManager()->WakeUp(WorldPos.x, WorldPos.y, WorldPos.z);
-
- cItems Pickups;
- cBlockToPickup::ToPickup(BlockType, BlockMeta, E_ITEM_EMPTY, Pickups);
- m_World->SpawnItemPickups(Pickups, WorldPos.x, WorldPos.y, WorldPos.z);
- }
- break;
- }
-
- case E_BLOCK_LADDER:
- {
- char Dir = cLadder::MetaDataToDirection( GetNibble( m_BlockMeta, BlockPos ) );
- Vector3i WorldPos = PositionToWorldPosition( BlockPos );
- Vector3i AttachedTo = WorldPos;
- AddDirection( AttachedTo.x, AttachedTo.y, AttachedTo.z, Dir, true );
- if( m_World->GetBlock( AttachedTo ) == E_BLOCK_AIR )
- {
- SetBlock( BlockPos, E_BLOCK_AIR, 0 );
- cItems Pickups;
- cBlockToPickup::ToPickup(BlockType, BlockMeta, E_ITEM_EMPTY, Pickups);
- m_World->SpawnItemPickups(Pickups, WorldPos.x, WorldPos.y, WorldPos.z);
- }
- break;
- }
- } // switch (BlockType)
- */
} // for itr - ToTickBlocks[]
}
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 531edb087..0212bd3b2 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -19,7 +19,6 @@
#include "cSign.h"
#include "cRedstone.h"
#include "cPiston.h"
-#include "cBlockToPickup.h"
#include "Mobs/Monster.h"
#include "cChatColor.h"
#include "cSocket.h"
diff --git a/source/cDoors.h b/source/cDoors.h
index 212e90062..71fec0d39 100644
--- a/source/cDoors.h
+++ b/source/cDoors.h
@@ -1,5 +1,4 @@
#pragma once
-#include "cBlockToPickup.h"
class cDoors //tolua_export
diff --git a/source/cPiston.cpp b/source/cPiston.cpp
index dd8541a10..4d6ccef0e 100644
--- a/source/cPiston.cpp
+++ b/source/cPiston.cpp
@@ -5,7 +5,6 @@
#include "cRedstone.h"
#include "ChunkDef.h"
#include "cPickup.h"
-#include "cBlockToPickup.h"
#include "cItem.h"
#include "cRoot.h"
#include "cClientHandle.h"
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index 4a7ff2fc7..533ee70cf 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -7,7 +7,6 @@
#include "ChunkDef.h"
#include "cClientHandle.h"
#include "cPickup.h"
-#include "cBlockToPickup.h"
#include "cPlayer.h"
#include "cServer.h"
#include "cItem.h"