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/ItemSword.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 '')
-rw-r--r-- | src/Items/ItemSword.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index a15a9e3db..26372cc40 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -56,6 +56,34 @@ public: return 0; #endif } + + + + virtual float GetBlockBreakingStrength(BLOCKTYPE a_Block) + { + if (a_Block == E_BLOCK_COBWEB) + { + return 15.0f; + } + else + { + if ( + IsBlockMaterialPlants(a_Block) || + IsBlockMaterialVine(a_Block) || + IsBlockMaterialCoral(a_Block) || + IsBlockMaterialLeaves(a_Block) || + IsBlockMaterialGourd(a_Block) + ) + { + return 1.5f; + } + else + { + return 1.0f; + } + } + } + } ; |