5 #include "../Bindings/PluginManager.h" 6 #include "../UI/BrewingstandWindow.h" 7 #include "../Entities/Player.h" 15 super(a_BlockType, a_BlockMeta, a_Pos, ContentsWidth, ContentsHeight, a_World),
32 if (Window !=
nullptr)
131 for (
int i = 0; i < 3; i++)
159 if (Window ==
nullptr)
165 if (Window !=
nullptr)
192 if (Window !=
nullptr)
250 for (
int i = 0; i < 3; i++)
270 if (Recipe !=
nullptr)
339 for (
int i = 0; i < 3; i++)
346 if (Recipe !=
nullptr)
cItem m_Results[3]
Result items for the bottle inputs.
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
void UpdateProgressBars(bool a_ForceUpdate=false)
Broadcasts progressbar updates, if needed.
bool m_IsBrewing
Set to true if the brewing stand is brewing an item.
short m_TimeBrewed
Amount of ticks that the current item has been brewed.
cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Constructor used for normal operation.
virtual ~cBrewingstandEntity() override
unsigned char BLOCKTYPE
The datatype used by blockdata.
const cItem & GetSlot(int a_SlotNum) const
void LoadRecipes(void)
Gets the recipes.
cWindow * GetWindow(void)
short m_RemainingFuel
The remaining fuel for the brewing stand.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
void OpenWindow(cWindow *a_Window)
void OwnerDestroyed(void)
virtual void Destroy() override
bool IsEqual(const cItem &a_Item) const
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
virtual void Destroy(void) override
static cPluginManager * Get(void)
Returns the instance of the Plugin Manager (there is only ever one)
cItem CopyOne(void) const
Returns a copy of this item with m_ItemCount set to 1.
const cRecipe * GetRecipeFrom(const cItem &a_Input, const cItem &a_Ingredient) const
Returns a recipe for the specified input, nullptr if no recipe found.
void AddListener(cListener &a_Listener)
Adds a callback that gets called whenever a slot changes.
cBrewingRecipes * GetBrewingRecipes(void)
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
cWindow * GetWindow(void) const
virtual Int64 GetWorldAge(void) const override
bool m_IsDestroyed
Set to true when the brewing stand entity has been destroyed to prevent the block being set again...
const cBrewingRecipes::cRecipe * m_CurrentBrewingRecipes[3]
Store the current brewing recipes.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
virtual void SetProperty(short a_Property, short a_Value)
Updates a numerical property associated with the window.
void ContinueBrewing(void)
Starts the brewing proccess.
virtual void OnSlotChanged(cItemGrid *a_ItemGrid, int a_SlotNum) override
Called whenever a slot changes.
bool CallHookBrewingCompleted(cWorld &a_World, cBrewingstandEntity &a_Brewingstand)
void BroadcastProgress(short a_ProgressbarID, short a_Value)
Sends the specified progressbar value to all clients of the window.
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
Called whenever a slot changes.
const short m_NeedBrewingTime
Brewing time is 400 ticks.
const cItem & GetSlot(int a_X, int a_Y) const
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
void OpenWindow(cWindow &a_Window)
Opens the specified window; closes the current one first using CloseWindow()
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...
void SetSlot(int a_X, int a_Y, const cItem &a_Item)