From 3c102870f600178b7cabf6714f83e06fc05b42fd Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 1 May 2014 00:47:57 +0200 Subject: Add anvil window and slot area. --- src/Items/ItemSword.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index a7c1d2432..34656ff99 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -23,6 +23,19 @@ public: { return (a_BlockType == E_BLOCK_COBWEB); } + + virtual bool CanRepairWithItem(const cItem & a_Item) override + { + switch (m_ItemType) + { + case E_ITEM_WOODEN_SWORD: return (a_Item.m_ItemType == E_BLOCK_PLANKS); + case E_ITEM_STONE_SWORD: return (a_Item.m_ItemType == E_BLOCK_COBBLESTONE); + case E_ITEM_IRON_SWORD: return (a_Item.m_ItemType == E_ITEM_IRON); + case E_ITEM_GOLD_SWORD: return (a_Item.m_ItemType == E_ITEM_GOLD); + case E_ITEM_DIAMOND_SWORD: return (a_Item.m_ItemType == E_ITEM_DIAMOND); + } + return false; + } } ; -- cgit v1.2.3 From 954b59d6f460106e93efab39c8666d4692db25b6 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 6 May 2014 19:38:09 +0200 Subject: Rename CanRepairWithItem to CanRepairWithRawMaterial and rename Size() to Count() --- src/Items/ItemSword.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index 34656ff99..44feb2d83 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -24,15 +24,15 @@ public: return (a_BlockType == E_BLOCK_COBWEB); } - virtual bool CanRepairWithItem(const cItem & a_Item) override + virtual bool CanRepairWithRawMaterial(short a_ItemType) override { switch (m_ItemType) { - case E_ITEM_WOODEN_SWORD: return (a_Item.m_ItemType == E_BLOCK_PLANKS); - case E_ITEM_STONE_SWORD: return (a_Item.m_ItemType == E_BLOCK_COBBLESTONE); - case E_ITEM_IRON_SWORD: return (a_Item.m_ItemType == E_ITEM_IRON); - case E_ITEM_GOLD_SWORD: return (a_Item.m_ItemType == E_ITEM_GOLD); - case E_ITEM_DIAMOND_SWORD: return (a_Item.m_ItemType == E_ITEM_DIAMOND); + case E_ITEM_WOODEN_SWORD: return (a_ItemType == E_BLOCK_PLANKS); + case E_ITEM_STONE_SWORD: return (a_ItemType == E_BLOCK_COBBLESTONE); + case E_ITEM_IRON_SWORD: return (a_ItemType == E_ITEM_IRON); + case E_ITEM_GOLD_SWORD: return (a_ItemType == E_ITEM_GOLD); + case E_ITEM_DIAMOND_SWORD: return (a_ItemType == E_ITEM_DIAMOND); } return false; } -- cgit v1.2.3 From 396739cc0faf01a099acbe669c5a9def98d3aaae Mon Sep 17 00:00:00 2001 From: Howaner Date: Wed, 23 Jul 2014 16:32:09 +0200 Subject: Fix item durability. Fixes #1181 --- src/Items/ItemSword.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index 44feb2d83..8fd70bd7b 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -12,18 +12,20 @@ class cItemSwordHandler : public cItemHandler { + typedef cItemHandler super; public: cItemSwordHandler(int a_ItemType) : cItemHandler(a_ItemType) { - } - + + virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override { return (a_BlockType == E_BLOCK_COBWEB); } + virtual bool CanRepairWithRawMaterial(short a_ItemType) override { switch (m_ItemType) @@ -36,6 +38,17 @@ public: } return false; } + + + virtual short GetDurabilityLostWithThatAction(eDurabilityLostAction a_Action) override + { + switch (a_Action) + { + case dlaAttackEntity: return 1; + case dlaBreakBlock: return 2; + } + return 0; + } } ; -- cgit v1.2.3 From 3a6002de5b13c1cd56d904892e5af6123978225d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 24 Jul 2014 21:38:25 +0100 Subject: Fixed block drops * Fixes #1242 (the issue addressed within) --- src/Items/ItemSword.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index 44feb2d83..368b8724e 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -16,7 +16,6 @@ public: cItemSwordHandler(int a_ItemType) : cItemHandler(a_ItemType) { - } virtual bool CanHarvestBlock(BLOCKTYPE a_BlockType) override -- cgit v1.2.3 From 4de8f5ca2926068eb855ba19c35de2a63ddebf28 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 26 Jul 2014 13:26:14 +0200 Subject: Rename function. --- src/Items/ItemSword.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index 1a17023ef..b90965535 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -44,7 +44,7 @@ public: } - virtual short GetDurabilityLostWithThatAction(eDurabilityLostAction a_Action) override + virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) override { switch (a_Action) { -- cgit v1.2.3 From fd4ee20b2a927649b4671be95dccc8644c96e5ab Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 27 Jul 2014 23:15:51 +0200 Subject: Hotfixed compilation problems. --- src/Items/ItemSword.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items/ItemSword.h') diff --git a/src/Items/ItemSword.h b/src/Items/ItemSword.h index b90965535..2b2dbfc0d 100644 --- a/src/Items/ItemSword.h +++ b/src/Items/ItemSword.h @@ -46,7 +46,7 @@ public: virtual short GetDurabilityLossByAction(eDurabilityLostAction a_Action) override { - switch (a_Action) + switch ((int)a_Action) { case dlaAttackEntity: return 1; case dlaBreakBlock: return 2; -- cgit v1.2.3