5 #include "../BrewingRecipes.h"
51 virtual bool Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
const cItem & GetSlot(int a_SlotNum) const
cBlockEntityWithItems(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, int a_ItemGridWidth, int a_ItemGridHeight, cWorld *a_World)
void SetSlot(int a_SlotNum, const cItem &a_Item)
bool m_IsBrewing
Set to true if the brewing stand is brewing an item.
virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking.
short m_RemainingFuel
The remaining fuel for the brewing stand.
short GetTimeBrewed(void)
Returns the time that the current items has been brewing, in ticks.
void SetLeftBottleSlot(const cItem &a_Item)
Sets the item in the left bottle slot
virtual void OnSlotChanged(cItemGrid *a_ItemGrid, int a_SlotNum) override
Called whenever a slot changes.
void SetIngredientSlot(const cItem &a_Item)
Sets the item in the ingredient slot
const cItem & GetIndgredientSlot(void) const
Returns the item in the ingredient slot
void ContinueBrewing(void)
Starts the brewing proccess.
void SetRightBottleSlot(const cItem &a_Item)
Sets the item in the right bottle slot
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
short GetBrewingTimeLeft(void) const
Returns the time until the current items finishes brewing, in ticks.
void LoadRecipes(void)
Gets the recipes.
void SetFuelSlot(const cItem &a_Item)
Sets the item in the fuel slot
virtual void OnRemoveFromWorld() override
Called when the block entity object is removed from a world.
const cItem & GetLeftBottleSlot(void) const
Returns the item in the left bottle slot
short GetRemainingFuel(void)
Returns the remaining fuel that is left.
void SetMiddleBottleSlot(const cItem &a_Item)
Sets the item in the middle bottle slot
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
std::array< const cBrewingRecipes::cRecipe *, 3 > m_CurrentBrewingRecipes
Store the current brewing recipes.
const cItem & GetFuelSlot(void) const
Returns the item in the fuel slot.
void BroadcastProgress(size_t a_ProgressbarID, short a_Value)
Sends the specified progressbar value to all clients of the window.
void SetTimeBrewed(short a_TimeBrewed)
Sets the current brewing time.
const cItem & GetMiddleBottleSlot(void) const
Returns the item in the middle bottle slot
const cItem & GetResultItem(size_t a_SlotNumber)
Get the expected result item for the given slot number.
void UpdateProgressBars(bool a_ForceUpdate=false)
const cItem & GetRightBottleSlot(void) const
Returns the item in the right bottle slot
std::array< cItem, 3 > m_Results
Result items for the bottle inputs.
const short m_NeedBrewingTime
Brewing time is 400 ticks.
void SetRemainingFuel(short a_RemainingFuel)
Sets the remaining fuel.
cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Constructor used for normal operation.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
short m_TimeBrewed
Amount of ticks that the current item has been brewed.