Files

65 lines
1.9 KiB
C
Raw Permalink Normal View History

2026-03-01 12:16:08 +08:00
#pragma once
#include "AbstractContainerMenu.h"
#include "Slot.h"
class BrewingStandTileEntity;
class Inventory;
class Player;
class Container;
class BrewingStandMenu : public AbstractContainerMenu
{
// 4J Stu - Made public so that we can access these from the XUI menus
public:
static const int INGREDIENT_SLOT = 3;
static const int BOTTLE_SLOT_START = 0;
static const int BOTTLE_SLOT_END = 2;
static const int INV_SLOT_START = INGREDIENT_SLOT + 1;
static const int INV_SLOT_END = INV_SLOT_START + 9 * 3;
static const int USE_ROW_SLOT_START = INV_SLOT_END;
static const int USE_ROW_SLOT_END = USE_ROW_SLOT_START + 9;
private:
shared_ptr<BrewingStandTileEntity> brewingStand;
2026-03-01 12:16:08 +08:00
Slot *ingredientSlot;
public:
BrewingStandMenu(shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand);
2026-03-01 12:16:08 +08:00
private:
int tc;
public:
virtual void addSlotListener(ContainerListener *listener);
virtual void broadcastChanges();
virtual void setData(int id, int value);
virtual bool stillValid(shared_ptr<Player> player);
virtual shared_ptr<ItemInstance> quickMoveStack(shared_ptr<Player> player, int slotIndex);
2026-03-01 12:16:08 +08:00
private:
class PotionSlot : public Slot
{
private:
shared_ptr<Player> player;
2026-03-01 12:16:08 +08:00
public:
PotionSlot(shared_ptr<Player> player, shared_ptr<Container> container, int slot, int x, int y);
2026-03-01 12:16:08 +08:00
virtual bool mayPlace(shared_ptr<ItemInstance> item);
virtual int getMaxStackSize() const;
virtual void onTake(shared_ptr<Player> player, shared_ptr<ItemInstance> carried);
static bool mayPlaceItem(shared_ptr<ItemInstance> item);
virtual bool mayCombine(shared_ptr<ItemInstance> item); // 4J Added
2026-03-01 12:16:08 +08:00
};
class IngredientsSlot : public Slot
{
public:
IngredientsSlot(shared_ptr<Container> container, int slot, int x, int y);
2026-03-01 12:16:08 +08:00
virtual bool mayPlace(shared_ptr<ItemInstance> item);
virtual int getMaxStackSize() const;
virtual bool mayCombine(shared_ptr<ItemInstance> item); // 4J Added
2026-03-01 12:16:08 +08:00
};
};