summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemPickaxe.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemPickaxe.h')
-rw-r--r--src/Items/ItemPickaxe.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h
index 2a8e40daa..17fd96822 100644
--- a/src/Items/ItemPickaxe.h
+++ b/src/Items/ItemPickaxe.h
@@ -8,6 +8,7 @@
class cItemPickaxeHandler :
public cItemHandler
{
+ typedef cItemHandler super;
public:
cItemPickaxeHandler(int a_ItemType)
: cItemHandler(a_ItemType)
@@ -17,7 +18,7 @@ public:
char PickaxeLevel()
{
- switch(m_ItemType)
+ switch (m_ItemType)
{
case E_ITEM_WOODEN_PICKAXE: return 1;
case E_ITEM_GOLD_PICKAXE: return 1;
@@ -31,7 +32,7 @@ public:
virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override
{
- switch(a_BlockType)
+ switch (a_BlockType)
{
case E_BLOCK_OBSIDIAN:
{
@@ -76,6 +77,7 @@ public:
case E_BLOCK_STONE_PRESSURE_PLATE:
case E_BLOCK_BRICK:
case E_BLOCK_COBBLESTONE_STAIRS:
+ case E_BLOCK_COBBLESTONE_WALL:
case E_BLOCK_STONE_BRICK_STAIRS:
case E_BLOCK_NETHER_BRICK_STAIRS:
case E_BLOCK_CAULDRON:
@@ -83,6 +85,19 @@ public:
return PickaxeLevel() >= 1;
}
}
+ return super::CanHarvestBlock(a_BlockType);
+ }
+
+ virtual bool CanRepairWithRawMaterial(short a_ItemType) override
+ {
+ switch (m_ItemType)
+ {
+ case E_ITEM_WOODEN_PICKAXE: return (a_ItemType == E_BLOCK_PLANKS);
+ case E_ITEM_STONE_PICKAXE: return (a_ItemType == E_BLOCK_COBBLESTONE);
+ case E_ITEM_IRON_PICKAXE: return (a_ItemType == E_ITEM_IRON);
+ case E_ITEM_GOLD_PICKAXE: return (a_ItemType == E_ITEM_GOLD);
+ case E_ITEM_DIAMOND_PICKAXE: return (a_ItemType == E_ITEM_DIAMOND);
+ }
return false;
}
} ;