summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemShovel.h
diff options
context:
space:
mode:
authormohe2015 <mohe2015@users.noreply.github.com>2016-11-06 19:30:19 +0100
committerMattes D <github@xoft.cz>2016-11-06 19:30:19 +0100
commit32b38fb2649fb282b6446c4e544866c0161aa7da (patch)
tree51d2fd4d507b9f46e80d90f357a6fee78d2f5ffa /src/Items/ItemShovel.h
parentMerge pull request #3416 from cuberite/JsonSerializerErrorReport (diff)
downloadcuberite-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/ItemShovel.h')
-rw-r--r--src/Items/ItemShovel.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Items/ItemShovel.h b/src/Items/ItemShovel.h
index 739ed833e..e5aae26a7 100644
--- a/src/Items/ItemShovel.h
+++ b/src/Items/ItemShovel.h
@@ -59,4 +59,35 @@ public:
return false;
}
+ virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block)
+ {
+ switch (a_Block)
+ {
+ case E_BLOCK_CLAY:
+ case E_BLOCK_DIRT:
+ case E_BLOCK_FARMLAND:
+ case E_BLOCK_GRASS:
+ case E_BLOCK_GRAVEL:
+ case E_BLOCK_MYCELIUM:
+ case E_BLOCK_SAND:
+ case E_BLOCK_SNOW:
+ case E_BLOCK_SNOW_BLOCK:
+ case E_BLOCK_SOULSAND:
+ case E_BLOCK_GRASS_PATH:
+ {
+ switch (m_ItemType)
+ {
+ case E_ITEM_WOODEN_SHOVEL: return 2.0f;
+ case E_ITEM_STONE_SHOVEL: return 4.0f;
+ case E_ITEM_IRON_SHOVEL: return 6.0f;
+ case E_ITEM_GOLD_SHOVEL: return 12.0f;
+ case E_ITEM_DIAMOND_SHOVEL: return 8.0f;
+ }
+ break;
+ }
+ default: return super::GetBlockBreakingStrength(a_Block);
+ }
+ ASSERT(!"Something is wrong here... Maybe they are shovels out of a new material?");
+ return 1.0f;
+ }
};