mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-23 22:23:38 +00:00
70 lines
2.2 KiB
C++
70 lines
2.2 KiB
C++
#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:
|
|
std::shared_ptr<BrewingStandTileEntity> brewingStand;
|
|
Slot* ingredientSlot;
|
|
|
|
public:
|
|
BrewingStandMenu(std::shared_ptr<Inventory> inventory,
|
|
std::shared_ptr<BrewingStandTileEntity> brewingStand);
|
|
|
|
private:
|
|
int tc;
|
|
|
|
public:
|
|
virtual void addSlotListener(ContainerListener* listener);
|
|
virtual void broadcastChanges();
|
|
virtual void setData(int id, int value);
|
|
virtual bool stillValid(std::shared_ptr<Player> player);
|
|
virtual std::shared_ptr<ItemInstance> quickMoveStack(
|
|
std::shared_ptr<Player> player, int slotIndex);
|
|
|
|
private:
|
|
class PotionSlot : public Slot {
|
|
private:
|
|
std::shared_ptr<Player> player;
|
|
|
|
public:
|
|
PotionSlot(std::shared_ptr<Player> player,
|
|
std::shared_ptr<Container> container, int slot, int x,
|
|
int y);
|
|
|
|
virtual bool mayPlace(std::shared_ptr<ItemInstance> item);
|
|
virtual int getMaxStackSize();
|
|
virtual void onTake(std::shared_ptr<Player> player,
|
|
std::shared_ptr<ItemInstance> carried);
|
|
static bool mayPlaceItem(std::shared_ptr<ItemInstance> item);
|
|
virtual bool mayCombine(
|
|
std::shared_ptr<ItemInstance> item); // 4J Added
|
|
};
|
|
|
|
class IngredientsSlot : public Slot {
|
|
public:
|
|
IngredientsSlot(std::shared_ptr<Container> container, int slot, int x,
|
|
int y);
|
|
|
|
virtual bool mayPlace(std::shared_ptr<ItemInstance> item);
|
|
virtual int getMaxStackSize();
|
|
virtual bool mayCombine(
|
|
std::shared_ptr<ItemInstance> item); // 4J Added
|
|
};
|
|
}; |