summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items')
-rw-r--r--src/Items/ItemHandler.cpp2
-rw-r--r--src/Items/ItemHandler.h3
-rw-r--r--src/Items/ItemPickaxe.h22
3 files changed, 15 insertions, 12 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 507f7fa86..1d357fcf1 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -285,7 +285,7 @@ void cItemHandler::OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const
UNUSED(a_Item);
BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- cBlockHandler * Handler = cBlockHandler::GetBlockHandler(Block);
+ cBlockHandler * Handler = cBlockInfo::GetHandler(Block);
if (a_Player->IsGameModeSurvival())
{
diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h
index ef3f37a7a..5b6c239cc 100644
--- a/src/Items/ItemHandler.h
+++ b/src/Items/ItemHandler.h
@@ -21,6 +21,9 @@ class cItemHandler
public:
cItemHandler(int a_ItemType);
+ // Force virtual destructor
+ virtual ~cItemHandler() {}
+
/// Called when the player tries to use the item (right mouse button). Return false to make the item unusable. DEFAULT: False
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir);
diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h
index bde7f0905..2a8e40daa 100644
--- a/src/Items/ItemPickaxe.h
+++ b/src/Items/ItemPickaxe.h
@@ -19,17 +19,13 @@ public:
{
switch(m_ItemType)
{
- case E_ITEM_WOODEN_PICKAXE:
- case E_ITEM_GOLD_PICKAXE:
- return 1;
- case E_ITEM_STONE_PICKAXE:
- return 2;
- case E_ITEM_IRON_PICKAXE:
- return 3;
- case E_ITEM_DIAMOND_PICKAXE:
- return 4;
- default:
- return 0;
+ case E_ITEM_WOODEN_PICKAXE: return 1;
+ case E_ITEM_GOLD_PICKAXE: return 1;
+ case E_ITEM_STONE_PICKAXE: return 2;
+ case E_ITEM_IRON_PICKAXE: return 3;
+ case E_ITEM_DIAMOND_PICKAXE: return 4;
+
+ default: return 0;
}
}
@@ -61,6 +57,10 @@ public:
return PickaxeLevel() >= 2;
}
+ case E_BLOCK_ANVIL:
+ case E_BLOCK_ENCHANTMENT_TABLE:
+ case E_BLOCK_FURNACE:
+ case E_BLOCK_LIT_FURNACE:
case E_BLOCK_COAL_ORE:
case E_BLOCK_STONE:
case E_BLOCK_COBBLESTONE: