diff options
author | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-16 21:20:37 +0200 |
---|---|---|
committer | lapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-07-16 21:20:37 +0200 |
commit | 86a991c5a85a9771143320de91d87f6e986300a9 (patch) | |
tree | dee2b3b326103217b982a49c90a489eb35235392 | |
parent | Fixed a copypasta error in previous commit (diff) | |
download | cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar.gz cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar.bz2 cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar.lz cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar.xz cuberite-86a991c5a85a9771143320de91d87f6e986300a9.tar.zst cuberite-86a991c5a85a9771143320de91d87f6e986300a9.zip |
77 files changed, 259 insertions, 413 deletions
diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj index d00153cd6..f060fb3fe 100644 --- a/VC2008/MCServer.vcproj +++ b/VC2008/MCServer.vcproj @@ -1954,10 +1954,6 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockCloth.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockCloth.h"
>
</File>
@@ -1966,10 +1962,6 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockDirt.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockDirt.h"
>
</File>
@@ -1986,18 +1978,10 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockEntity.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockEntity.h"
>
</File>
<File
- RelativePath="..\source\blocks\BlockFire.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockFire.h"
>
</File>
@@ -2078,10 +2062,6 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockSlab.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockSlab.h"
>
</File>
@@ -2090,10 +2070,6 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockStairs.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockStairs.h"
>
</File>
@@ -2114,18 +2090,10 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockTorch.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockTorch.h"
>
</File>
<File
- RelativePath="..\source\blocks\BlockVine.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockVine.h"
>
</File>
@@ -2134,10 +2102,6 @@ >
</File>
<File
- RelativePath="..\source\blocks\BlockWorkbench.cpp"
- >
- </File>
- <File
RelativePath="..\source\blocks\BlockWorkbench.h"
>
</File>
diff --git a/VC2010/MCServer.vcxproj b/VC2010/MCServer.vcxproj index 54a1a70e4..1bbf7617c 100644 --- a/VC2010/MCServer.vcxproj +++ b/VC2010/MCServer.vcxproj @@ -305,19 +305,10 @@ <ClCompile Include="..\source\BioGen.cpp" />
<ClCompile Include="..\source\BlockArea.cpp" />
<ClCompile Include="..\source\BlockID.cpp" />
- <ClCompile Include="..\source\blocks\BlockCloth.cpp" />
- <ClCompile Include="..\source\blocks\BlockDirt.cpp" />
<ClCompile Include="..\source\blocks\BlockDoor.cpp" />
- <ClCompile Include="..\source\blocks\BlockEntity.cpp" />
- <ClCompile Include="..\source\blocks\BlockFire.cpp" />
<ClCompile Include="..\source\blocks\BlockPiston.cpp" />
<ClCompile Include="..\source\blocks\BlockRedstone.cpp" />
<ClCompile Include="..\source\blocks\BlockRedstoneRepeater.cpp" />
- <ClCompile Include="..\source\blocks\BlockSlab.cpp" />
- <ClCompile Include="..\source\blocks\BlockStairs.cpp" />
- <ClCompile Include="..\source\blocks\BlockTorch.cpp" />
- <ClCompile Include="..\source\blocks\BlockVine.cpp" />
- <ClCompile Include="..\source\blocks\BlockWorkbench.cpp" />
<ClCompile Include="..\source\blocks\Block.cpp" />
<ClCompile Include="..\source\cAggressiveMonster.cpp" />
<ClCompile Include="..\Source\cAuthenticator.cpp" />
diff --git a/VC2010/MCServer.vcxproj.filters b/VC2010/MCServer.vcxproj.filters index c9a39ea6b..b93c2a334 100644 --- a/VC2010/MCServer.vcxproj.filters +++ b/VC2010/MCServer.vcxproj.filters @@ -926,12 +926,6 @@ <ClCompile Include="..\source\cSquirrelCommandBinder.cpp">
<Filter>cPluginManager\cSquirrelCommandBinder</Filter>
</ClCompile>
- <ClCompile Include="..\source\blocks\BlockEntity.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockFire.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
<ClCompile Include="..\source\blocks\BlockPiston.cpp">
<Filter>Blocks</Filter>
</ClCompile>
@@ -941,24 +935,6 @@ <ClCompile Include="..\source\blocks\BlockRedstoneRepeater.cpp">
<Filter>Blocks</Filter>
</ClCompile>
- <ClCompile Include="..\source\blocks\BlockSlab.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockTorch.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockVine.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockWorkbench.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockCloth.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
- <ClCompile Include="..\source\blocks\BlockDirt.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
<ClCompile Include="..\source\blocks\BlockDoor.cpp">
<Filter>Blocks</Filter>
</ClCompile>
@@ -968,9 +944,6 @@ <ClCompile Include="..\source\items\Item.cpp">
<Filter>Items</Filter>
</ClCompile>
- <ClCompile Include="..\source\blocks\BlockStairs.cpp">
- <Filter>Blocks</Filter>
- </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\source\cServer.h">
diff --git a/source/BlockID.cpp b/source/BlockID.cpp index 46a8ef5ca..f9c78705b 100644 --- a/source/BlockID.cpp +++ b/source/BlockID.cpp @@ -56,7 +56,7 @@ static cBlockIDMap gsBlockIDMap; -int BlockStringToType(const AString & a_BlockTypeString) +BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString) { int res = atoi(a_BlockTypeString.c_str()); if ((res != 0) || (a_BlockTypeString.compare("0") == 0)) diff --git a/source/BlockID.h b/source/BlockID.h index becc0cad8..4f3a3d3ed 100644 --- a/source/BlockID.h +++ b/source/BlockID.h @@ -617,7 +617,7 @@ class cItem; /// Translates a blocktype string into blocktype. Takes either a number or an items.ini alias as input. Returns -1 on failure. -extern int BlockStringToType(const AString & a_BlockTypeString); // tolua_export +extern BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString); // tolua_export /// Translates an itemtype string into an item. Takes either a number, number^number, number:number or an items.ini alias as input. Returns true if successful. extern bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item); // tolua_export diff --git a/source/blocks/Block.cpp b/source/blocks/Block.cpp index 1fd7a1af8..215a6c618 100644 --- a/source/blocks/Block.cpp +++ b/source/blocks/Block.cpp @@ -42,7 +42,7 @@ bool cBlockHandler::m_HandlerInitialized = false;
cBlockHandler *cBlockHandler::m_BlockHandler[256];
-cBlockHandler *cBlockHandler::GetBlockHandler(char a_BlockID)
+cBlockHandler *cBlockHandler::GetBlockHandler(BLOCKTYPE a_BlockID)
{
if(!m_HandlerInitialized)
{ //We have to initialize
@@ -227,7 +227,7 @@ void cBlockHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y }
-void cBlockHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+void cBlockHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, a_BlockMeta);
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
@@ -249,7 +249,7 @@ int cBlockHandler::GetDropID() return m_BlockID;
}
-char cBlockHandler::GetDropMeta(char a_BlockMeta)
+NIBBLETYPE cBlockHandler::GetDropMeta(NIBBLETYPE a_BlockMeta)
{
return a_BlockMeta; //This keeps most textures. The few other blocks have to override this
}
@@ -257,7 +257,7 @@ char cBlockHandler::GetDropMeta(char a_BlockMeta) void cBlockHandler::DropBlock(cWorld *a_World, int a_X, int a_Y, int a_Z)
{
cItems Drops;
- char Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
+ NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
char DropCount = GetDropCount();
int DropItem = GetDropID();
if(DropCount > 0 && DropItem != E_ITEM_EMPTY)
diff --git a/source/blocks/Block.h b/source/blocks/Block.h index f55ee7dd2..e35856459 100644 --- a/source/blocks/Block.h +++ b/source/blocks/Block.h @@ -19,18 +19,17 @@ public: virtual void OnNeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z);
static void NeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z);
virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
virtual int GetTickRate();
virtual char GetDropCount();
virtual int GetDropID();
- virtual char GetDropMeta(char a_BlockMeta);
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta);
virtual bool NeedsRandomTicks();
- //Item is -2 if it wasn´t a player
virtual void DropBlock(cWorld *a_World, int a_X, int a_Y, int a_Z);
//Checks if the block can stay at
virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z);
- //Checks if the block can be placed at Default:CanBeAt(...) NOTE: In the block is not placed
+ //Checks if the block can be placed at this point. Default: CanBeAt(...) NOTE: In the block is not placed in this callback
virtual bool CanBePlacedAt(cWorld *a_World, int a_X, int a_Y, int a_Z, char a_Dir);
//This gets called if the player tries to place a block ontop of this block (Only if he aims directly on this block)
virtual bool AllowBlockOnTop();
@@ -42,7 +41,7 @@ public: //Does this block drops if it gets destroyed by an unsuitable situation? Default: true
virtual bool DropOnUnsuitable();
- static cBlockHandler *GetBlockHandler(char a_BlockID);
+ static cBlockHandler *GetBlockHandler(BLOCKTYPE a_BlockID);
static void Deinit();
@@ -54,4 +53,4 @@ protected: };
-inline cBlockHandler *BlockHandler(char a_BlockID) { return cBlockHandler::GetBlockHandler(a_BlockID); }
\ No newline at end of file +inline cBlockHandler *BlockHandler(BLOCKTYPE a_BlockID) { return cBlockHandler::GetBlockHandler(a_BlockID); }
\ No newline at end of file diff --git a/source/blocks/BlockCactus.h b/source/blocks/BlockCactus.h index 4977d4a98..5eb351d9c 100644 --- a/source/blocks/BlockCactus.h +++ b/source/blocks/BlockCactus.h @@ -10,12 +10,12 @@ public: {
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
BLOCKTYPE Surface = a_World->GetBlock(a_X, a_Y - 1, a_Z);
if ((Surface != E_BLOCK_SAND) && (Surface != E_BLOCK_CACTUS))
@@ -38,13 +38,13 @@ public: return true;
}
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockChest.h b/source/blocks/BlockChest.h index 557b2d640..fd444a9d2 100644 --- a/source/blocks/BlockChest.h +++ b/source/blocks/BlockChest.h @@ -12,7 +12,7 @@ public: {
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), 0));
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
diff --git a/source/blocks/BlockCloth.cpp b/source/blocks/BlockCloth.cpp deleted file mode 100644 index a55b8dc7f..000000000 --- a/source/blocks/BlockCloth.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Globals.h"
-#include "BlockCloth.h"
-#include "../cItem.h"
-#include "../cPlayer.h"
-
-cBlockClothHandler::cBlockClothHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
\ No newline at end of file diff --git a/source/blocks/BlockCloth.h b/source/blocks/BlockCloth.h index dca7184cb..f2ce78fb5 100644 --- a/source/blocks/BlockCloth.h +++ b/source/blocks/BlockCloth.h @@ -5,8 +5,12 @@ class cBlockClothHandler : public cBlockHandler
{
public:
- cBlockClothHandler(BLOCKTYPE a_BlockID);
- char GetDropMeta(char a_BlockMeta)
+ cBlockClothHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
+
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return a_BlockMeta;
}
diff --git a/source/blocks/BlockCrops.h b/source/blocks/BlockCrops.h index 34af1a43c..fb4934540 100644 --- a/source/blocks/BlockCrops.h +++ b/source/blocks/BlockCrops.h @@ -16,12 +16,17 @@ public: return true;
}
- virtual int GetDropID()
+ virtual bool AllowBlockOnTop() override
+ {
+ return false;
+ }
+
+ virtual int GetDropID() override
{
return E_ITEM_EMPTY;
}
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
MTRand rand;
NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
@@ -42,13 +47,13 @@ public: a_World->SpawnItemPickups(Drops, a_X, a_Y, a_Z);
}
- void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
//TODO: Handle Growing here
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) == E_BLOCK_FARMLAND;
}
diff --git a/source/blocks/BlockDirt.cpp b/source/blocks/BlockDirt.cpp deleted file mode 100644 index ea8c6509d..000000000 --- a/source/blocks/BlockDirt.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "Globals.h"
-#include "BlockDirt.h"
-#include "../cItem.h"
-#include "../cWorld.h"
-
-cBlockDirtHandler::cBlockDirtHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
diff --git a/source/blocks/BlockDirt.h b/source/blocks/BlockDirt.h index 49450b16d..2edfa5608 100644 --- a/source/blocks/BlockDirt.h +++ b/source/blocks/BlockDirt.h @@ -6,21 +6,24 @@ class cBlockDirtHandler : public cBlockHandler
{
public:
- cBlockDirtHandler(BLOCKTYPE a_BlockID);
+ cBlockDirtHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
- virtual bool NeedsRandomTicks()
+ virtual bool NeedsRandomTicks() override
{
return m_BlockID == E_BLOCK_GRASS;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_BLOCK_DIRT;
}
- void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
if(m_BlockID == E_BLOCK_GRASS)
{
diff --git a/source/blocks/BlockDispenser.h b/source/blocks/BlockDispenser.h index 4ccfe0dfc..f3ad20d5c 100644 --- a/source/blocks/BlockDispenser.h +++ b/source/blocks/BlockDispenser.h @@ -12,7 +12,7 @@ public: {
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), 0));
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
diff --git a/source/blocks/BlockDoor.cpp b/source/blocks/BlockDoor.cpp index e854281a5..3fc804704 100644 --- a/source/blocks/BlockDoor.cpp +++ b/source/blocks/BlockDoor.cpp @@ -48,7 +48,7 @@ char cBlockDoorHandler::GetDropCount() return 1;
}
-void cBlockDoorHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+void cBlockDoorHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
if (a_World->GetBlock(a_X, a_Y + 1, a_Z) == E_BLOCK_AIR)
{
diff --git a/source/blocks/BlockDoor.h b/source/blocks/BlockDoor.h index 180d3b48f..ccf7dd4a7 100644 --- a/source/blocks/BlockDoor.h +++ b/source/blocks/BlockDoor.h @@ -6,23 +6,23 @@ class cBlockDoorHandler : public cBlockHandler {
public:
cBlockDoorHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual char GetDropCount();
- virtual bool IsUseable()
+ virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
+ virtual char GetDropCount() override;
+ virtual bool IsUseable() override
{
return true;
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override;
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return (m_BlockID == E_BLOCK_WOODEN_DOOR) ? E_ITEM_WOODEN_DOOR : E_ITEM_IRON_DOOR;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockEntity.cpp b/source/blocks/BlockEntity.cpp deleted file mode 100644 index b34b01ee9..000000000 --- a/source/blocks/BlockEntity.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Globals.h"
-#include "BlockEntity.h"
-#include "../cItem.h"
-#include "../cPlayer.h"
-#include "../cWorld.h"
-
-cBlockEntityHandler::cBlockEntityHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockEntityHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
-{
- a_World->UseBlockEntity(a_Player, a_X, a_Y, a_Z);
-}
diff --git a/source/blocks/BlockEntity.h b/source/blocks/BlockEntity.h index abdaa7615..c7b8b0859 100644 --- a/source/blocks/BlockEntity.h +++ b/source/blocks/BlockEntity.h @@ -5,9 +5,15 @@ class cBlockEntityHandler : public cBlockHandler
{
public:
- cBlockEntityHandler(BLOCKTYPE a_BlockID);
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual bool IsUseable()
+ cBlockEntityHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
+ {
+ a_World->UseBlockEntity(a_Player, a_X, a_Y, a_Z);
+ }
+ virtual bool IsUseable() override
{
return true;
}
diff --git a/source/blocks/BlockFire.cpp b/source/blocks/BlockFire.cpp deleted file mode 100644 index 5ca8dd902..000000000 --- a/source/blocks/BlockFire.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Globals.h"
-#include "BlockFire.h"
-#include "../cItem.h"
-#include "../cWorld.h"
-
-cBlockFireHandler::cBlockFireHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockFireHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
-{
- a_World->DigBlock(a_X, a_Y, a_Z);
-}
-
-char cBlockFireHandler::GetDropCount()
-{
- return -1;
-}
-
-bool cBlockFireHandler::IsClickedThrough()
-{
- return true;
-}
\ No newline at end of file diff --git a/source/blocks/BlockFire.h b/source/blocks/BlockFire.h index 0a5396096..f1563c637 100644 --- a/source/blocks/BlockFire.h +++ b/source/blocks/BlockFire.h @@ -5,10 +5,25 @@ class cBlockFireHandler : public cBlockHandler
{
public:
- cBlockFireHandler(BLOCKTYPE a_BlockID);
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual bool IsClickedThrough();
- virtual char GetDropCount();
+ cBlockFireHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
+
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
+ {
+ a_World->DigBlock(a_X, a_Y, a_Z);
+ }
+
+ virtual char GetDropCount() override
+ {
+ return -1;
+ }
+
+ virtual bool IsClickedThrough() override
+ {
+ return true;
+ }
};
\ No newline at end of file diff --git a/source/blocks/BlockFlower.h b/source/blocks/BlockFlower.h index 12eaa4dc8..b94e6cb6d 100644 --- a/source/blocks/BlockFlower.h +++ b/source/blocks/BlockFlower.h @@ -10,22 +10,22 @@ public: {
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return IsBlockTypeOfDirt(a_World->GetBlock(a_X, a_Y - 1, a_Z));
}
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockFluid.h b/source/blocks/BlockFluid.h index 4da785523..6883ce715 100644 --- a/source/blocks/BlockFluid.h +++ b/source/blocks/BlockFluid.h @@ -11,7 +11,7 @@ public: }
- virtual bool IgnoreBuildCollision()
+ virtual bool IgnoreBuildCollision() override
{
return true;
}
diff --git a/source/blocks/BlockFurnace.h b/source/blocks/BlockFurnace.h index 927c925bd..d0455e805 100644 --- a/source/blocks/BlockFurnace.h +++ b/source/blocks/BlockFurnace.h @@ -12,12 +12,12 @@ public: {
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_FURNACE;
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), 0));
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
diff --git a/source/blocks/BlockGlowstone.h b/source/blocks/BlockGlowstone.h index 8d05cd799..ecd34a1d9 100644 --- a/source/blocks/BlockGlowstone.h +++ b/source/blocks/BlockGlowstone.h @@ -10,12 +10,12 @@ public: {
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_GLOWSTONE_DUST;
}
diff --git a/source/blocks/BlockIce.h b/source/blocks/BlockIce.h index 9b356e323..d6bb63b0a 100644 --- a/source/blocks/BlockIce.h +++ b/source/blocks/BlockIce.h @@ -11,12 +11,12 @@ public: {
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_EMPTY;
}
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
a_World->FastSetBlock(a_X, a_Y, a_Z, E_BLOCK_STATIONARY_WATER, 8);
//This is called later than the real destroying of this ice block
diff --git a/source/blocks/BlockLadder.h b/source/blocks/BlockLadder.h index b32f8081d..4c7f37b1f 100644 --- a/source/blocks/BlockLadder.h +++ b/source/blocks/BlockLadder.h @@ -12,7 +12,7 @@ public: }
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cLadder::DirectionToMetaData(a_Dir));
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
diff --git a/source/blocks/BlockLeaves.h b/source/blocks/BlockLeaves.h index 4bae2003f..57cfad5da 100644 --- a/source/blocks/BlockLeaves.h +++ b/source/blocks/BlockLeaves.h @@ -28,7 +28,7 @@ public: {
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
MTRand rand;
@@ -40,7 +40,7 @@ public: return E_ITEM_EMPTY;
}
- void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
cBlockHandler::OnDestroyed(a_World, a_X, a_Y, a_Z);
@@ -56,18 +56,18 @@ public: }
}
- virtual void OnNeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual void OnNeighborChanged(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
a_World->SetBlockMeta(a_X, a_Y, a_Z, Meta & 0x7); //Unset 0x8 bit so it gets checked for decay
}
- virtual bool NeedsRandomTicks()
+ virtual bool NeedsRandomTicks() override
{
return true;
}
- virtual void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
if ((Meta & 0x04) != 0)
diff --git a/source/blocks/BlockMelon.h b/source/blocks/BlockMelon.h index d64461780..0f1797a0b 100644 --- a/source/blocks/BlockMelon.h +++ b/source/blocks/BlockMelon.h @@ -11,12 +11,12 @@ public: }
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_MELON_SLICE;
}
- virtual char GetDropCount()
+ virtual char GetDropCount() override
{
MTRand r1;
return (char)(3 + r1.randInt(4));
diff --git a/source/blocks/BlockMushroom.h b/source/blocks/BlockMushroom.h index 5b2da6498..5ec429c5f 100644 --- a/source/blocks/BlockMushroom.h +++ b/source/blocks/BlockMushroom.h @@ -10,12 +10,12 @@ public: {
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
switch (a_World->GetBlock(a_X, a_Y - 1, a_Z))
{
@@ -29,13 +29,13 @@ public: return true;
}
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockOre.h b/source/blocks/BlockOre.h index d1714f1af..4788c9b89 100644 --- a/source/blocks/BlockOre.h +++ b/source/blocks/BlockOre.h @@ -26,7 +26,7 @@ public: }
}
- virtual char GetDropMeta(char a_Meta) override
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_Meta) override
{
switch(m_BlockID)
{
diff --git a/source/blocks/BlockPiston.cpp b/source/blocks/BlockPiston.cpp index 98463fd97..c2fcdd1f2 100644 --- a/source/blocks/BlockPiston.cpp +++ b/source/blocks/BlockPiston.cpp @@ -40,7 +40,7 @@ void cBlockPistonHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z }
}
-void cBlockPistonHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+void cBlockPistonHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cPiston::RotationPitchToMetaData(a_Player->GetRotation(), a_Player->GetPitch()));
diff --git a/source/blocks/BlockPiston.h b/source/blocks/BlockPiston.h index 69d3a204f..1493ff27e 100644 --- a/source/blocks/BlockPiston.h +++ b/source/blocks/BlockPiston.h @@ -6,10 +6,10 @@ class cBlockPistonHandler : public cBlockHandler {
public:
cBlockPistonHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
+ virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override;
};
\ No newline at end of file diff --git a/source/blocks/BlockRedstone.cpp b/source/blocks/BlockRedstone.cpp index 1171d124a..58edaa1cd 100644 --- a/source/blocks/BlockRedstone.cpp +++ b/source/blocks/BlockRedstone.cpp @@ -26,7 +26,7 @@ void cBlockRedstoneHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a Redstone.ChangeRedstone(a_X, a_Y, a_Z, false);
}
-void cBlockRedstoneHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+void cBlockRedstoneHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
switch(m_BlockID)
{
diff --git a/source/blocks/BlockRedstone.h b/source/blocks/BlockRedstone.h index 21c19d4c5..dd2c75fc4 100644 --- a/source/blocks/BlockRedstone.h +++ b/source/blocks/BlockRedstone.h @@ -6,27 +6,27 @@ class cBlockRedstoneHandler : public cBlockHandler {
public:
cBlockRedstoneHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
+ virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override;
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) != E_BLOCK_AIR;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_REDSTONE_DUST;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockRedstoneRepeater.cpp b/source/blocks/BlockRedstoneRepeater.cpp index 639764aa5..79214069a 100644 --- a/source/blocks/BlockRedstoneRepeater.cpp +++ b/source/blocks/BlockRedstoneRepeater.cpp @@ -27,7 +27,7 @@ void cBlockRedstoneRepeaterHandler::OnClick(cWorld *a_World, cPlayer *a_Player, a_World->FastSetBlock(a_X, a_Y, a_Z, m_BlockID, ((a_World->GetBlockMeta(a_X, a_Y, a_Z) + 0x04) & 0x0f));
}
-void cBlockRedstoneRepeaterHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+void cBlockRedstoneRepeaterHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
{
a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cRedstone::RepeaterRotationToMetaData(a_Player->GetRotation()));
OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
diff --git a/source/blocks/BlockRedstoneRepeater.h b/source/blocks/BlockRedstoneRepeater.h index e8618cdeb..4b6b60485 100644 --- a/source/blocks/BlockRedstoneRepeater.h +++ b/source/blocks/BlockRedstoneRepeater.h @@ -6,40 +6,40 @@ class cBlockRedstoneRepeaterHandler : public cBlockHandler {
public:
cBlockRedstoneRepeaterHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
+ virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir) override;
+ virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z) override;
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override;
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_REDSTONE_REPEATER;
}
- virtual bool IsUseable()
+ virtual bool IsUseable() override
{
return true;
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override;
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) != E_BLOCK_AIR;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockRedstoneTorch.h b/source/blocks/BlockRedstoneTorch.h index 927cf3d7c..0b8be74e1 100644 --- a/source/blocks/BlockRedstoneTorch.h +++ b/source/blocks/BlockRedstoneTorch.h @@ -24,12 +24,12 @@ public: return CanBePlacedAt(a_World, a_X, a_Y, a_Z, Dir);
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_REDSTONE_TORCH_ON;
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return true;
}
diff --git a/source/blocks/BlockSapling.h b/source/blocks/BlockSapling.h index d0498afea..6bef614cf 100644 --- a/source/blocks/BlockSapling.h +++ b/source/blocks/BlockSapling.h @@ -15,22 +15,22 @@ public: return true;
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return a_BlockMeta & 3; //Only the first 2 bits contain the display information the others are for growing
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return IsBlockTypeOfDirt(a_World->GetBlock(a_X, a_Y - 1, a_Z));
}
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
- void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
NIBBLETYPE Meta = a_World->GetBlockMeta(a_X, a_Y, a_Z);
@@ -44,7 +44,7 @@ public: }
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockSign.h b/source/blocks/BlockSign.h index 3b2e208e1..2a7ac2753 100644 --- a/source/blocks/BlockSign.h +++ b/source/blocks/BlockSign.h @@ -13,7 +13,7 @@ public: }
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
{
BLOCKTYPE Block;
NIBBLETYPE Meta;
@@ -30,12 +30,12 @@ public: OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_SIGN;
}
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
diff --git a/source/blocks/BlockSlab.cpp b/source/blocks/BlockSlab.cpp deleted file mode 100644 index 659dc7986..000000000 --- a/source/blocks/BlockSlab.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Globals.h"
-#include "BlockSlab.h"
-#include "../cItem.h"
-#include "../cPlayer.h"
-#include "../cWorld.h"
-
-cBlockSlabHandler::cBlockSlabHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-
-void cBlockSlabHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
-{
- a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, DirectionToMetaData( a_Dir, a_BlockMeta ));
- OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
-}
\ No newline at end of file diff --git a/source/blocks/BlockSlab.h b/source/blocks/BlockSlab.h index 05df819b2..f6443ff91 100644 --- a/source/blocks/BlockSlab.h +++ b/source/blocks/BlockSlab.h @@ -5,13 +5,17 @@ class cBlockSlabHandler : public cBlockHandler
{
public:
- cBlockSlabHandler(BLOCKTYPE a_BlockID);
- virtual char GetDropMeta(char a_BlockMeta)
+ cBlockSlabHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
+
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return a_BlockMeta;
}
- virtual char GetDropCount()
+ virtual char GetDropCount() override
{
if(m_BlockID == E_BLOCK_DOUBLE_STONE_SLAB
|| m_BlockID == E_BLOCK_DOUBLE_WOODEN_SLAB)
@@ -19,7 +23,12 @@ public: return 1;
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
+ {
+ a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, DirectionToMetaData( a_Dir, a_BlockMeta ));
+ OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
+ }
static char DirectionToMetaData( char a_Direction, NIBBLETYPE Meta )
{
diff --git a/source/blocks/BlockSnow.h b/source/blocks/BlockSnow.h index 75143b73e..ac0c0ac69 100644 --- a/source/blocks/BlockSnow.h +++ b/source/blocks/BlockSnow.h @@ -10,28 +10,28 @@ public: {
}
- virtual bool IgnoreBuildCollision()
+ virtual bool IgnoreBuildCollision() override
{
return true;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_SNOWBALL;
}
- virtual char GetDropCount()
+ virtual char GetDropCount() override
{
return 4;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) != E_BLOCK_AIR;
}
- virtual bool DropOnUnsuitable()
+ virtual bool DropOnUnsuitable() override
{
return false;
}
diff --git a/source/blocks/BlockStairs.cpp b/source/blocks/BlockStairs.cpp deleted file mode 100644 index cd4ad9907..000000000 --- a/source/blocks/BlockStairs.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Globals.h"
-#include "BlockStairs.h"
-#include "../cItem.h"
-#include "../cVine.h"
-#include "../cPlayer.h"
-#include "../cWorld.h"
-#include "../cStairs.h"
-
-cBlockStairsHandler::cBlockStairsHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockStairsHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
-{
- a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cStairs::RotationToMetaData(a_Player->GetRotation(), a_Dir));
- OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
-}
\ No newline at end of file diff --git a/source/blocks/BlockStairs.h b/source/blocks/BlockStairs.h index d7de17c1f..b6898f8e1 100644 --- a/source/blocks/BlockStairs.h +++ b/source/blocks/BlockStairs.h @@ -1,14 +1,22 @@ #pragma once
#include "Block.h"
-
+#include "../cStairs.h"
class cBlockStairsHandler : public cBlockHandler
{
public:
- cBlockStairsHandler(BLOCKTYPE a_BlockID);
+ cBlockStairsHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+
+ }
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
+ {
+ a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cStairs::RotationToMetaData(a_Player->GetRotation(), a_Dir));
+ OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
+ }
};
\ No newline at end of file diff --git a/source/blocks/BlockStems.h b/source/blocks/BlockStems.h index 8f1d4ddca..a58a2bdf4 100644 --- a/source/blocks/BlockStems.h +++ b/source/blocks/BlockStems.h @@ -11,29 +11,29 @@ public: {
}
- virtual bool NeedsRandomTicks()
+ virtual bool NeedsRandomTicks() override
{
return true;
}
- virtual char GetDropMeta(char a_BlockMeta)
+ virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return 0;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
if(m_BlockID == E_BLOCK_MELON_STEM)
return E_ITEM_MELON_SEEDS;
return E_ITEM_PUMPKIN_SEEDS;
}
- void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
//TODO: Handle Growing here
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) == E_BLOCK_FARMLAND;
}
diff --git a/source/blocks/BlockStone.h b/source/blocks/BlockStone.h index d15e4730a..bd644a3a4 100644 --- a/source/blocks/BlockStone.h +++ b/source/blocks/BlockStone.h @@ -11,7 +11,7 @@ public: {
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_COBBLESTONE;
}
diff --git a/source/blocks/BlockSugarcane.h b/source/blocks/BlockSugarcane.h index 610052880..f402c4c28 100644 --- a/source/blocks/BlockSugarcane.h +++ b/source/blocks/BlockSugarcane.h @@ -11,17 +11,17 @@ public: {
}
- virtual bool NeedsRandomTicks()
+ virtual bool NeedsRandomTicks() override
{
return true;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_SUGARCANE;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
BLOCKTYPE Block = a_World->GetBlock(a_X, a_Y-1, a_Z);
if(!IsBlockTypeOfDirt(Block) && Block != E_BLOCK_SAND && Block != E_BLOCK_SUGARCANE)
@@ -30,13 +30,13 @@ public: return a_World->IsBlockDirectlyWatered(a_X, a_Y - 1, a_Z);
}
- void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
//TODO: Handle Growing here
}
- virtual bool CanBePlacedOnSide()
+ virtual bool CanBePlacedOnSide() override
{
return false;
}
diff --git a/source/blocks/BlockTallGrass.h b/source/blocks/BlockTallGrass.h index a702bb8ca..ac66c1714 100644 --- a/source/blocks/BlockTallGrass.h +++ b/source/blocks/BlockTallGrass.h @@ -10,17 +10,17 @@ public: {
}
- virtual bool IgnoreBuildCollision()
+ virtual bool IgnoreBuildCollision() override
{
return true;
}
- virtual int GetDropID()
+ virtual int GetDropID() override
{
return E_ITEM_SEEDS;
}
- virtual char GetDropCount()
+ virtual char GetDropCount() override
{
MTRand r1;
if(r1.randInt(10) == 5)
@@ -28,7 +28,7 @@ public: return 0;
}
- virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z)
+ virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
{
return a_World->GetBlock(a_X, a_Y - 1, a_Z) != E_BLOCK_AIR;
}
diff --git a/source/blocks/BlockTorch.cpp b/source/blocks/BlockTorch.cpp deleted file mode 100644 index d9597a9ac..000000000 --- a/source/blocks/BlockTorch.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "Globals.h"
-#include "BlockTorch.h"
-#include "../cTorch.h"
-#include "../cWorld.h"
-
-cBlockTorchHandler::cBlockTorchHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockTorchHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
-{
- a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cTorch::DirectionToMetaData(a_Dir));
- OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
-}
\ No newline at end of file diff --git a/source/blocks/BlockTorch.h b/source/blocks/BlockTorch.h index 9a2325994..562536c6e 100644 --- a/source/blocks/BlockTorch.h +++ b/source/blocks/BlockTorch.h @@ -7,11 +7,18 @@ class cBlockTorchHandler : public cBlockHandler
{
public:
- cBlockTorchHandler(BLOCKTYPE a_BlockID);
+ cBlockTorchHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
+ {
+ a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cTorch::DirectionToMetaData(a_Dir));
+ OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
+ }
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
diff --git a/source/blocks/BlockVine.cpp b/source/blocks/BlockVine.cpp deleted file mode 100644 index fda3c818c..000000000 --- a/source/blocks/BlockVine.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "Globals.h"
-#include "BlockVine.h"
-#include "../cItem.h"
-#include "../cVine.h"
-#include "../cPlayer.h"
-#include "../cWorld.h"
-
-cBlockVineHandler::cBlockVineHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockVineHandler::PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir)
-{
- a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cVine::DirectionToMetaData(a_Dir));
- OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
-}
\ No newline at end of file diff --git a/source/blocks/BlockVine.h b/source/blocks/BlockVine.h index d601e622c..86f73b6b2 100644 --- a/source/blocks/BlockVine.h +++ b/source/blocks/BlockVine.h @@ -1,21 +1,28 @@ #pragma once
#include "Block.h"
-
+#include "../cVine.h"
class cBlockVineHandler : public cBlockHandler
{
public:
- cBlockVineHandler(BLOCKTYPE a_BlockID);
-
- virtual bool IgnoreBuildCollision()
+ cBlockVineHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
+
+ virtual bool IgnoreBuildCollision() override
{
return true;
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, char a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir);
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, NIBBLETYPE a_BlockMeta, int a_X, int a_Y, int a_Z, char a_Dir) override
+ {
+ a_World->SetBlock(a_X, a_Y, a_Z, m_BlockID, cVine::DirectionToMetaData(a_Dir));
+ OnPlacedByPlayer(a_World, a_Player, a_X, a_Y, a_Z, a_Dir);
+ }
- virtual bool AllowBlockOnTop()
+ virtual bool AllowBlockOnTop() override
{
return false;
}
diff --git a/source/blocks/BlockWood.h b/source/blocks/BlockWood.h index c93c44b4f..453ee48a1 100644 --- a/source/blocks/BlockWood.h +++ b/source/blocks/BlockWood.h @@ -9,7 +9,7 @@ public: : cBlockHandler(a_BlockID)
{
}
- char GetDropMeta(char a_BlockMeta)
+ NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
{
return a_BlockMeta;
}
diff --git a/source/blocks/BlockWorkbench.cpp b/source/blocks/BlockWorkbench.cpp deleted file mode 100644 index 095a6e1da..000000000 --- a/source/blocks/BlockWorkbench.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Globals.h"
-#include "BlockWorkbench.h"
-#include "../cItem.h"
-#include "../cPlayer.h"
-#include "../cCraftingWindow.h"
-
-cBlockWorkbenchHandler::cBlockWorkbenchHandler(BLOCKTYPE a_BlockID)
- : cBlockHandler(a_BlockID)
-{
-}
-
-void cBlockWorkbenchHandler::OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir)
-{
-}
-
-void cBlockWorkbenchHandler::OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z)
-{
-}
-
-void cBlockWorkbenchHandler::OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z)
-{
- cWindow* Window = new cCraftingWindow(0, true);
- a_Player->OpenWindow(Window);
-}
diff --git a/source/blocks/BlockWorkbench.h b/source/blocks/BlockWorkbench.h index 2a0936c08..d654ca666 100644 --- a/source/blocks/BlockWorkbench.h +++ b/source/blocks/BlockWorkbench.h @@ -1,16 +1,23 @@ #pragma once
#include "Block.h"
-
+#include "../cCraftingWindow.h"
+#include "../cPlayer.h"
class cBlockWorkbenchHandler : public cBlockHandler
{
public:
- cBlockWorkbenchHandler(BLOCKTYPE a_BlockID);
- virtual void OnPlaced(cWorld *a_World, int a_X, int a_Y, int a_Z, int a_Dir);
- virtual void OnDestroyed(cWorld *a_World, int a_X, int a_Y, int a_Z);
+ cBlockWorkbenchHandler(BLOCKTYPE a_BlockID)
+ : cBlockHandler(a_BlockID)
+ {
+ }
- virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z);
- virtual bool IsUseable()
+ virtual void OnClick(cWorld *a_World, cPlayer *a_Player, int a_X, int a_Y, int a_Z) override
+ {
+ cWindow* Window = new cCraftingWindow(0, true);
+ a_Player->OpenWindow(Window);
+ }
+
+ virtual bool IsUseable() override
{
return true;
}
diff --git a/source/items/Item.cpp b/source/items/Item.cpp index e6129bbd2..3dd0a4218 100644 --- a/source/items/Item.cpp +++ b/source/items/Item.cpp @@ -209,10 +209,16 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockID) BLOCKTYPE cItemHandler::GetBlockType()
{
- return m_ItemID;
+#ifdef _DEBUG
+ if(m_ItemID > 256)
+ {
+ LOGERROR("Item %d has no valid block!", m_ItemID);
+ }
+#endif
+ return (BLOCKTYPE) m_ItemID;
}
-NIBBLETYPE cItemHandler::GetBlockMeta(char a_ItemMeta)
+NIBBLETYPE cItemHandler::GetBlockMeta(NIBBLETYPE a_ItemMeta)
{
return a_ItemMeta; //This keeps most textures. The few other items have to override this
}
diff --git a/source/items/Item.h b/source/items/Item.h index 14780e6ee..96f957fcf 100644 --- a/source/items/Item.h +++ b/source/items/Item.h @@ -24,7 +24,7 @@ public: virtual bool IsPlaceable();
virtual BLOCKTYPE GetBlockType();
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta);
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta);
virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID);
diff --git a/source/items/ItemBucket.h b/source/items/ItemBucket.h index e223d47f1..c74fc68ee 100644 --- a/source/items/ItemBucket.h +++ b/source/items/ItemBucket.h @@ -12,7 +12,7 @@ public: }
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
switch(m_ItemID)
{
diff --git a/source/items/ItemCloth.h b/source/items/ItemCloth.h index e3ab0c74b..ead4ee84a 100644 --- a/source/items/ItemCloth.h +++ b/source/items/ItemCloth.h @@ -11,7 +11,7 @@ public: {
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return a_ItemMeta;
}
diff --git a/source/items/ItemDoor.h b/source/items/ItemDoor.h index 5b656ce17..ac5bc6872 100644 --- a/source/items/ItemDoor.h +++ b/source/items/ItemDoor.h @@ -12,12 +12,12 @@ public: }
- virtual bool IsPlaceable()
+ virtual bool IsPlaceable() override
{
return true;
}
- virtual BLOCKTYPE GetBlockType()
+ virtual BLOCKTYPE GetBlockType() override
{
return (m_ItemID == E_ITEM_WOODEN_DOOR) ? E_BLOCK_WOODEN_DOOR : E_BLOCK_IRON_DOOR;
}
diff --git a/source/items/ItemDye.h b/source/items/ItemDye.h index 60a1ed289..5cf470e04 100644 --- a/source/items/ItemDye.h +++ b/source/items/ItemDye.h @@ -7,12 +7,12 @@ class cItemDyeHandler : public cItemHandler {
public:
cItemDyeHandler(int a_ItemID)
- : cItemHandler(a_ItemID)
+ : cItemHandler(a_ItemID)
{
}
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
// TODO: Handle coloring the sheep, too (OnItemUseOnEntity maybe)
// Handle growing the plants:
diff --git a/source/items/ItemHoe.h b/source/items/ItemHoe.h index dd73f4ac9..64dc4ca34 100644 --- a/source/items/ItemHoe.h +++ b/source/items/ItemHoe.h @@ -7,12 +7,12 @@ class cItemHoeHandler : public cItemHandler {
public:
cItemHoeHandler(int a_ItemID)
- : cItemHandler(a_ItemID)
+ : cItemHandler(a_ItemID)
{
}
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
BLOCKTYPE Block = a_World->GetBlock(a_X, a_Y, a_Z);
diff --git a/source/items/ItemLeaves.h b/source/items/ItemLeaves.h index 03f0ce8f3..bc1519806 100644 --- a/source/items/ItemLeaves.h +++ b/source/items/ItemLeaves.h @@ -10,8 +10,8 @@ public: : cItemHandler(a_ItemID)
{
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
- return a_ItemMeta | 0x4; //0x4 bit set means this is a player-placed leaves block, not to be decayed
+ return a_ItemMeta | 0x4; //0x4 bit set means this is a player places leave
}
};
\ No newline at end of file diff --git a/source/items/ItemLighter.h b/source/items/ItemLighter.h index 287a7742f..213677e4e 100644 --- a/source/items/ItemLighter.h +++ b/source/items/ItemLighter.h @@ -13,7 +13,7 @@ public: }
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
a_Player->UseEquippedItem();
diff --git a/source/items/ItemPickaxe.h b/source/items/ItemPickaxe.h index c9b36ae7b..a179d154f 100644 --- a/source/items/ItemPickaxe.h +++ b/source/items/ItemPickaxe.h @@ -30,7 +30,7 @@ public: }
}
- virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID)
+ virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID) override
{
switch(a_BlockID)
{
diff --git a/source/items/ItemRedstoneDust.h b/source/items/ItemRedstoneDust.h index ccae0fd13..a0aee1e5e 100644 --- a/source/items/ItemRedstoneDust.h +++ b/source/items/ItemRedstoneDust.h @@ -10,17 +10,17 @@ public: {
}
- virtual bool IsPlaceable()
+ virtual bool IsPlaceable() override
{
return true;
}
- virtual BLOCKTYPE GetBlockType()
+ virtual BLOCKTYPE GetBlockType() override
{
return E_BLOCK_REDSTONE_WIRE;
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return 0;
}
diff --git a/source/items/ItemRedstoneRepeater.h b/source/items/ItemRedstoneRepeater.h index 57f6eeb77..8dd309a91 100644 --- a/source/items/ItemRedstoneRepeater.h +++ b/source/items/ItemRedstoneRepeater.h @@ -10,17 +10,17 @@ public: {
}
- virtual bool IsPlaceable()
+ virtual bool IsPlaceable() override
{
return true;
}
- virtual BLOCKTYPE GetBlockType()
+ virtual BLOCKTYPE GetBlockType() override
{
return ::E_BLOCK_REDSTONE_REPEATER_OFF;
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return 0;
}
diff --git a/source/items/ItemSapling.h b/source/items/ItemSapling.h index 35a201f81..23894b812 100644 --- a/source/items/ItemSapling.h +++ b/source/items/ItemSapling.h @@ -12,7 +12,7 @@ public: }
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
//Only the first 2 bits are important
return a_ItemMeta & 3;
diff --git a/source/items/ItemSeeds.h b/source/items/ItemSeeds.h index bf0c38789..1d7f93613 100644 --- a/source/items/ItemSeeds.h +++ b/source/items/ItemSeeds.h @@ -12,17 +12,12 @@ public: }
- virtual bool IsPlaceable()
+ virtual bool IsPlaceable() override
{
return true;
}
-
- virtual bool AllowBlockOnTop()
- {
- return false;
- }
- virtual BLOCKTYPE GetBlockType()
+ virtual BLOCKTYPE GetBlockType() override
{
switch(m_ItemID)
{
@@ -37,12 +32,12 @@ public: }
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return 0; //Not grown yet
}
- virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual void PlaceBlock(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
int X = a_X,
Y = a_Y,
diff --git a/source/items/ItemShears.h b/source/items/ItemShears.h index 786ea5f5e..ab2981aae 100644 --- a/source/items/ItemShears.h +++ b/source/items/ItemShears.h @@ -12,7 +12,7 @@ public: {
}
- virtual bool IsTool()
+ virtual bool IsTool() override
{
return true;
}
@@ -33,7 +33,7 @@ public: }
- virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID)
+ virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID) override
{
return a_BlockID == E_BLOCK_COBWEB
|| a_BlockID == E_BLOCK_VINES;
diff --git a/source/items/ItemShovel.h b/source/items/ItemShovel.h index 5fd21cc26..3279ef419 100644 --- a/source/items/ItemShovel.h +++ b/source/items/ItemShovel.h @@ -9,7 +9,7 @@ class cItemShovelHandler : public cItemHandler {
public:
cItemShovelHandler(int a_ItemID)
- : cItemHandler(a_ItemID)
+ : cItemHandler(a_ItemID)
{
}
@@ -28,7 +28,7 @@ public: return false;
}
- virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID)
+ virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID) override
{
return a_BlockID == E_BLOCK_SNOW;
}
diff --git a/source/items/ItemSlab.h b/source/items/ItemSlab.h index 54186d704..38b0aa213 100644 --- a/source/items/ItemSlab.h +++ b/source/items/ItemSlab.h @@ -12,7 +12,7 @@ public: }
- virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir)
+ virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, cItem *a_Item, int a_X, int a_Y, int a_Z, char a_Dir) override
{
BLOCKTYPE Block;
NIBBLETYPE Meta;
@@ -32,7 +32,7 @@ public: return false;
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return a_ItemMeta;
}
diff --git a/source/items/ItemSugarcane.h b/source/items/ItemSugarcane.h index b79a3c6c7..778a20dbf 100644 --- a/source/items/ItemSugarcane.h +++ b/source/items/ItemSugarcane.h @@ -12,22 +12,17 @@ public: }
- virtual bool IsPlaceable()
+ virtual bool IsPlaceable() override
{
return true;
}
- virtual bool AllowBlockOnTop()
- {
- return false;
- }
-
- virtual BLOCKTYPE GetBlockType()
+ virtual BLOCKTYPE GetBlockType() override
{
return E_BLOCK_SUGARCANE;
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return 0; //Not grown yet
}
diff --git a/source/items/ItemSword.h b/source/items/ItemSword.h index f49436d51..cbe172c8f 100644 --- a/source/items/ItemSword.h +++ b/source/items/ItemSword.h @@ -12,7 +12,7 @@ public: }
- virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID)
+ virtual bool CanHarvestBlock(BLOCKTYPE a_BlockID) override
{
return a_BlockID == E_BLOCK_COBWEB;
}
diff --git a/source/items/ItemWood.h b/source/items/ItemWood.h index 3254b70ed..13aba198d 100644 --- a/source/items/ItemWood.h +++ b/source/items/ItemWood.h @@ -10,7 +10,7 @@ public: : cItemHandler(a_ItemID)
{
}
- virtual NIBBLETYPE GetBlockMeta(char a_ItemMeta) override
+ virtual NIBBLETYPE GetBlockMeta(NIBBLETYPE a_ItemMeta) override
{
return a_ItemMeta;
}
diff --git a/source/main.cpp b/source/main.cpp index 0f51e27d8..4b498ae0a 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -137,12 +137,12 @@ int main( int argc, char **argv ) // Parse arguments for minidump flags: for (int i = 0; i < argc; i++) { - if (stricmp(argv[i], "/cdg") == 0) + if (_stricmp(argv[i], "/cdg") == 0) { // Add globals to the dump g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithDataSegs); } - else if (stricmp(argv[i], "/cdf") == 0) + else if (_stricmp(argv[i], "/cdf") == 0) { // Add full memory to the dump (HUUUGE file) g_DumpFlags = (MINIDUMP_TYPE)(g_DumpFlags | MiniDumpWithFullMemory); |