From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/BrewingStandMenu.h | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Minecraft.World/BrewingStandMenu.h (limited to 'Minecraft.World/BrewingStandMenu.h') diff --git a/Minecraft.World/BrewingStandMenu.h b/Minecraft.World/BrewingStandMenu.h new file mode 100644 index 00000000..1f8d705d --- /dev/null +++ b/Minecraft.World/BrewingStandMenu.h @@ -0,0 +1,65 @@ +#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 brewingStand; + Slot *ingredientSlot; + +public: + BrewingStandMenu(shared_ptr inventory, shared_ptr brewingStand); + +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); + virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); + +private: + class PotionSlot : public Slot + { + private: + shared_ptr player; + + public: + PotionSlot(shared_ptr player, shared_ptr container, int slot, int x, int y); + + virtual bool mayPlace(shared_ptr item); + virtual int getMaxStackSize(); + virtual void onTake(shared_ptr player, shared_ptr carried); + static bool mayPlaceItem(shared_ptr item); + virtual bool mayCombine(shared_ptr item); // 4J Added + }; + + class IngredientsSlot : public Slot + { + public: + IngredientsSlot(shared_ptr container, int slot, int x, int y); + + virtual bool mayPlace(shared_ptr item); + virtual int getMaxStackSize(); + virtual bool mayCombine(shared_ptr item); // 4J Added + }; +}; \ No newline at end of file -- cgit v1.2.3