summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemSword.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-23 20:02:44 +0100
committerHowaner <franzi.moos@googlemail.com>2014-02-23 20:02:44 +0100
commitcc34898e45113df8ad7ae4b58debd2fe000f9622 (patch)
tree5218db21447a627af29ea68a4a2b28571a9cb7b2 /src/Items/ItemSword.h
parentUpdated CONTRIBUTING file with formatting and essential rules. (diff)
downloadcuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar.gz
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar.bz2
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar.lz
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar.xz
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.tar.zst
cuberite-cc34898e45113df8ad7ae4b58debd2fe000f9622.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemSword.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h
index a7c1d2432..07d121d5c 100644
--- a/src/Items/ItemSword.h
+++ b/src/Items/ItemSword.h
@@ -23,6 +23,25 @@ public:
{
return (a_BlockType == E_BLOCK_COBWEB);
}
+
+ inline static bool IsSword(int id)
+ {
+ switch (id)
+ {
+ case E_ITEM_WOODEN_SWORD:
+ case E_ITEM_STONE_SWORD:
+ case E_ITEM_IRON_SWORD:
+ case E_ITEM_GOLD_SWORD:
+ case E_ITEM_DIAMOND_SWORD:
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+ }
} ;