From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/AbstractContainerMenu.h | 56 +++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/AbstractContainerMenu.h') diff --git a/Minecraft.World/AbstractContainerMenu.h b/Minecraft.World/AbstractContainerMenu.h index f34e1afc..5ac115de 100644 --- a/Minecraft.World/AbstractContainerMenu.h +++ b/Minecraft.World/AbstractContainerMenu.h @@ -14,28 +14,43 @@ class Container; class AbstractContainerMenu { public: - static const int CLICKED_OUTSIDE = -999; + static const int SLOT_CLICKED_OUTSIDE = -999; static const int CLICK_PICKUP = 0; static const int CLICK_QUICK_MOVE = 1; static const int CLICK_SWAP = 2; static const int CLICK_CLONE = 3; + static const int CLICK_THROW = 4; + static const int CLICK_QUICK_CRAFT = 5; + static const int CLICK_PICKUP_ALL = 6; + + static const int QUICKCRAFT_TYPE_CHARITABLE = 0; + static const int QUICKCRAFT_TYPE_GREEDY = 1; + static const int QUICKCRAFT_HEADER_START = 0; + static const int QUICKCRAFT_HEADER_CONTINUE = 1; + static const int QUICKCRAFT_HEADER_END = 2; // 4J Stu - Added these to fix problem with items picked up while in the creative menu replacing slots in the creative menu static const int CONTAINER_ID_CARRIED = -1; static const int CONTAINER_ID_INVENTORY = 0; static const int CONTAINER_ID_CREATIVE = -2; - vector > *lastSlots; - vector *slots; + vector > lastSlots; + vector slots; int containerId; private: short changeUid; + + int quickcraftType; + int quickcraftStatus; + unordered_set quickcraftSlots; + +private: bool m_bNeedsRendered; // 4J added protected: - vector *containerListeners; + vector containerListeners; // 4J Stu - The java does not have ctor here (being an abstract) but we need one to initialise the member variables // TODO Make sure all derived classes also call this @@ -46,18 +61,22 @@ protected: public: virtual ~AbstractContainerMenu(); virtual void addSlotListener(ContainerListener *listener); - vector > *getItems(); - void sendData(int id, int value); + virtual void removeSlotListener(ContainerListener *listener); + virtual vector > *getItems(); + virtual void sendData(int id, int value); virtual void broadcastChanges(); virtual bool needsRendered(); virtual bool clickMenuButton(shared_ptr player, int buttonId); - Slot *getSlotFor(shared_ptr c, int index); - Slot *getSlot(int index); + virtual Slot *getSlotFor(shared_ptr c, int index); + virtual Slot *getSlot(int index); virtual shared_ptr quickMoveStack(shared_ptr player, int slotIndex); - virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player); + virtual shared_ptr clicked(int slotIndex, int buttonNum, int clickType, shared_ptr player, bool looped = false); // 4J added looped param virtual bool mayCombine(Slot *slot, shared_ptr item); + virtual bool canTakeItemForPickAll(shared_ptr carried, Slot *target); + protected: virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr player); + public: virtual void removed(shared_ptr player); virtual void slotsChanged();// 4J used to take a shared_ptr container but wasn't using it, so removed to simplify things @@ -76,7 +95,7 @@ public: virtual bool stillValid(shared_ptr player) = 0; // 4J Stu Added for UI - unsigned int getSize() { return (unsigned int)slots->size(); } + unsigned int getSize() { return (unsigned int)slots.size(); } protected: @@ -85,4 +104,21 @@ protected: public: virtual bool isOverrideResultClick(int slotNum, int buttonNum); + + static int getQuickcraftType(int mask); + static int getQuickcraftHeader(int mask); + static int getQuickcraftMask(int header, int type); + static bool isValidQuickcraftType(int type); + +protected: + void resetQuickCraft(); + +public: + static bool canItemQuickReplace(Slot *slot, shared_ptr item, bool ignoreSize); + static void getQuickCraftSlotCount(unordered_set *quickCraftSlots, int quickCraftingType, shared_ptr item, int carry); + bool canDragTo(Slot *slot); + static int getRedstoneSignalFromContainer(shared_ptr container); + + // 4J Added + virtual bool isValidIngredient(shared_ptr item, int slotId); }; -- cgit v1.2.3