diff options
author | mohe2015 <mohe2015@users.noreply.github.com> | 2016-11-06 19:30:19 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-11-06 19:30:19 +0100 |
commit | 32b38fb2649fb282b6446c4e544866c0161aa7da (patch) | |
tree | 51d2fd4d507b9f46e80d90f357a6fee78d2f5ffa /src/Items/ItemPickaxe.h | |
parent | Merge pull request #3416 from cuberite/JsonSerializerErrorReport (diff) | |
download | cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.gz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.bz2 cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.lz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.xz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.zst cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.zip |
Diffstat (limited to 'src/Items/ItemPickaxe.h')
-rw-r--r-- | src/Items/ItemPickaxe.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index dba4926db..6e8452cd9 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -107,6 +107,29 @@ public: } return false; } + + + virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) + { + if (!IsBlockMaterialIron(a_Block) && !IsBlockMaterialAnvil(a_Block) && !IsBlockMaterialRock(a_Block)) + { + return super::GetBlockBreakingStrength(a_Block); + } + else + { + switch (m_ItemType) + { + case E_ITEM_WOODEN_PICKAXE: return 2.0f; + case E_ITEM_STONE_PICKAXE: return 4.0f; + case E_ITEM_IRON_PICKAXE: return 6.0f; + case E_ITEM_GOLD_PICKAXE: return 12.0f; + case E_ITEM_DIAMOND_PICKAXE: return 8.0f; + } + } + ASSERT(!"Something is wrong here... Maybe they are pickaxes out of a new material?"); + return 1.0f; + } + } ; |