From 9749c3aac9dbfbc46a919193c97bb9c9e5339e03 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Thu, 24 Sep 2015 10:48:33 +0200 Subject: Implemented brewing --- src/UI/SlotArea.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/UI/SlotArea.h') diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index b150c47a1..0ff36ce50 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -16,6 +16,7 @@ class cWindow; class cPlayer; class cBeaconEntity; +class cBrewingstandEntity; class cChestEntity; class cEnderChestEntity; class cFurnaceEntity; @@ -456,6 +457,35 @@ protected: +class cSlotAreaBrewingstand : + public cSlotArea, + public cItemGrid::cListener +{ + typedef cSlotArea super; + +public: + cSlotAreaBrewingstand(cBrewingstandEntity * a_Brewingstand, cWindow & a_ParentWindow); + + virtual ~cSlotAreaBrewingstand(); + + virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override; + virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override; + virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override; + virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override; +protected: + cBrewingstandEntity * m_Brewingstand; + + // cItemGrid::cListener overrides: + virtual void OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) override; + + /** Called after an item has been brewed to handle statistics etc. */ + void HandleBrewedItem(cPlayer & a_Player); +} ; + + + + + class cSlotAreaMinecartWithChest : public cSlotArea { -- cgit v1.2.3