From cf87169737fdeeee7d4b160688bbed7194e46147 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 24 May 2013 07:30:39 +0000 Subject: Refactored cInventory to use cItemGrid for the actual Storage This makes the API more orthogonal and is easier to use in the plugins. Also changes in the inventory are now propagated to the needed places (armor updates to BroadcastEntityEquipment etc.) even when the inventory is changed by a plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1503 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Blocks/BlockCauldron.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'source/Blocks/BlockCauldron.h') diff --git a/source/Blocks/BlockCauldron.h b/source/Blocks/BlockCauldron.h index 360604f85..571235441 100644 --- a/source/Blocks/BlockCauldron.h +++ b/source/Blocks/BlockCauldron.h @@ -29,8 +29,7 @@ public: case E_ITEM_WATER_BUCKET: { a_World->SetBlockMeta( a_BlockX, a_BlockY, a_BlockZ, 3 ); - cItem Item(a_Player->GetEquippedItem().m_ItemType, 1); - a_Player->GetInventory().RemoveItem(Item); + a_Player->GetInventory().RemoveOneEquippedItem(); cItem NewItem(E_ITEM_BUCKET, 1); a_Player->GetInventory().AddItem(NewItem); break; @@ -39,9 +38,8 @@ public: { if( Meta > 0 ) { - a_World->SetBlockMeta( a_BlockX, a_BlockY, a_BlockZ, --Meta ); - cItem Item(a_Player->GetEquippedItem().m_ItemType, 1); - a_Player->GetInventory().RemoveItem(Item); + a_World->SetBlockMeta( a_BlockX, a_BlockY, a_BlockZ, --Meta); + a_Player->GetInventory().RemoveOneEquippedItem(); cItem NewItem(E_ITEM_POTIONS, 1, 0); a_Player->GetInventory().AddItem(NewItem); } -- cgit v1.2.3