From cc34898e45113df8ad7ae4b58debd2fe000f9622 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sun, 23 Feb 2014 20:02:44 +0100 Subject: No Sword Block Destroying in Creative Mode --- src/Items/ItemSword.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/Items') 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; + } + } + } } ; -- cgit v1.2.3