summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemAxe.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/ItemAxe.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 '')
-rw-r--r--src/Items/ItemAxe.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/Items/ItemAxe.h b/src/Items/ItemAxe.h
new file mode 100644
index 000000000..656497199
--- /dev/null
+++ b/src/Items/ItemAxe.h
@@ -0,0 +1,48 @@
+
+#pragma once
+
+#include "ItemHandler.h"
+#include "../World.h"
+#include "../Entities/Player.h"
+
+
+
+
+
+class cItemAxeHandler :
+ public cItemHandler
+{
+ typedef cItemHandler super;
+public:
+ cItemAxeHandler(int a_ItemType)
+ : cItemHandler(a_ItemType)
+ {
+ }
+
+
+ virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block)
+ {
+ if (!IsBlockMaterialWood(a_Block) && !IsBlockMaterialPlants(a_Block) && !IsBlockMaterialVine(a_Block))
+ {
+ return super::GetBlockBreakingStrength(a_Block);
+ }
+ else
+ {
+ switch (m_ItemType)
+ {
+ case E_ITEM_WOODEN_AXE: return 2.0f;
+ case E_ITEM_STONE_AXE: return 4.0f;
+ case E_ITEM_IRON_AXE: return 6.0f;
+ case E_ITEM_GOLD_AXE: return 12.0f;
+ case E_ITEM_DIAMOND_AXE: return 8.0f;
+ }
+ }
+ ASSERT(!"Something is wrong here... Maybe they are axes out of a new material?");
+ return 1.0f;
+ }
+
+} ;
+
+
+
+