diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-07 01:18:58 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-07 01:18:58 +0100 |
commit | 347e80bdd88f894394373745859f405dc82c1819 (patch) | |
tree | 82bf1b2163cbf7c59bf3c0181583982f34912aca /src/UI/SlotArea.cpp | |
parent | Renamed animation function (diff) | |
download | cuberite-347e80bdd88f894394373745859f405dc82c1819.tar cuberite-347e80bdd88f894394373745859f405dc82c1819.tar.gz cuberite-347e80bdd88f894394373745859f405dc82c1819.tar.bz2 cuberite-347e80bdd88f894394373745859f405dc82c1819.tar.lz cuberite-347e80bdd88f894394373745859f405dc82c1819.tar.xz cuberite-347e80bdd88f894394373745859f405dc82c1819.tar.zst cuberite-347e80bdd88f894394373745859f405dc82c1819.zip |
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r-- | src/UI/SlotArea.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 7fd7cd996..e743f4bb3 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -8,6 +8,7 @@ #include "../Entities/Player.h" #include "../BlockEntities/ChestEntity.h" #include "../BlockEntities/DropSpenserEntity.h" +#include "../BlockEntities/EnderChestEntity.h" #include "../BlockEntities/FurnaceEntity.h" #include "../Items/ItemHandler.h" #include "Window.h" @@ -557,6 +558,38 @@ cCraftingRecipe & cSlotAreaCrafting::GetRecipeForPlayer(cPlayer & a_Player) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cSlotAreaEnderChest: + +cSlotAreaEnderChest::cSlotAreaEnderChest(cEnderChestEntity * a_EnderChest, cWindow & a_ParentWindow) : + cSlotArea(27, a_ParentWindow), + m_EnderChest(a_EnderChest) +{ +} + + + + + +const cItem * cSlotAreaEnderChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const +{ + // a_SlotNum ranges from 0 to 26, use that to index the chest entity's inventory directly: + return &(m_EnderChest->GetSlot(a_SlotNum)); +} + + + + + +void cSlotAreaEnderChest::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) +{ + m_EnderChest->SetSlot(a_SlotNum, a_Item); +} + + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cSlotAreaFurnace: cSlotAreaFurnace::cSlotAreaFurnace(cFurnaceEntity * a_Furnace, cWindow & a_ParentWindow) : |