diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-09-13 00:18:02 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-09-13 00:18:02 +0200 |
commit | 3e741134279e02d204a8d4638f2d46dfbf814d0c (patch) | |
tree | a6781315a66a2fb6f8c16ab21f9f36ea7741fb6d /src/UI/SlotArea.cpp | |
parent | Fixed friction being applied whilst airborne (diff) | |
download | cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar.gz cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar.bz2 cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar.lz cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar.xz cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.tar.zst cuberite-3e741134279e02d204a8d4638f2d46dfbf814d0c.zip |
Diffstat (limited to 'src/UI/SlotArea.cpp')
-rw-r--r-- | src/UI/SlotArea.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index b4facb2d3..999bed989 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -10,6 +10,7 @@ #include "../BlockEntities/DropSpenserEntity.h" #include "../BlockEntities/EnderChestEntity.h" #include "../BlockEntities/FurnaceEntity.h" +#include "../Entities/Minecart.h" #include "../Items/ItemHandler.h" #include "Window.h" #include "../CraftingRecipes.h" @@ -1920,6 +1921,40 @@ void cSlotAreaFurnace::HandleSmeltItem(const cItem & a_Result, cPlayer & a_Playe //////////////////////////////////////////////////////////////////////////////// +// cSlotAreaMinecartWithChest: + +cSlotAreaMinecartWithChest::cSlotAreaMinecartWithChest(cMinecartWithChest * a_Chest, cWindow & a_ParentWindow) : + cSlotArea(27, a_ParentWindow), + m_Chest(a_Chest) +{ +} + + + + + +const cItem * cSlotAreaMinecartWithChest::GetSlot(int a_SlotNum, cPlayer & a_Player) const +{ + // a_SlotNum ranges from 0 to 26, use that to index the minecart chest entity's inventory directly: + UNUSED(a_Player); + return &(m_Chest->GetSlot(a_SlotNum)); +} + + + + + +void cSlotAreaMinecartWithChest::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) +{ + UNUSED(a_Player); + m_Chest->SetSlot(a_SlotNum, a_Item); +} + + + + + +//////////////////////////////////////////////////////////////////////////////// // cSlotAreaInventoryBase: cSlotAreaInventoryBase::cSlotAreaInventoryBase(int a_NumSlots, int a_SlotOffset, cWindow & a_ParentWindow) : |