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/DispenserTile.h | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'Minecraft.World/DispenserTile.h') diff --git a/Minecraft.World/DispenserTile.h b/Minecraft.World/DispenserTile.h index 5bc892aa..1205be94 100644 --- a/Minecraft.World/DispenserTile.h +++ b/Minecraft.World/DispenserTile.h @@ -1,21 +1,20 @@ #pragma once -#include "EntityTile.h" +#include "BaseEntityTile.h" +#include "net.minecraft.core.h" class Player; class Mob; class ChunkRebuildData; -class DispenserTile : public EntityTile + +class DispenserTile : public BaseEntityTile { friend class Tile; friend class ChunkRebuildData; -private: - static const int DISPENSE_ITEM = 0; - static const int REMOVE_ITEM = 1; - static const int LEAVE_ITEM = 2; - public: static const int FACING_MASK = 0x7; + static const int TRIGGER_BIT = 8; + static BehaviorRegistry REGISTRY; protected: Random *random; @@ -28,31 +27,31 @@ protected: DispenserTile(int id); public: - virtual int getTickDelay(); - virtual int getResource(int data, Random *random, int playerBonusLevel); - virtual void onPlace(Level *level, int x, int y, int z); + virtual int getTickDelay(Level *level); + virtual void onPlace(Level *level, int x, int y, int z); private: void recalcLockDir(Level *level, int x, int y, int z); public: virtual Icon *getTexture(int face, int data); - //@Override - void registerIcons(IconRegister *iconRegister); + virtual void registerIcons(IconRegister *iconRegister); virtual bool TestUse(); - virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param + virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param -private: - void fireArrow(Level *level, int x, int y, int z, Random *random); +protected: + virtual void dispenseFrom(Level *level, int x, int y, int z); + virtual DispenseItemBehavior *getDispenseMethod(shared_ptr item); public: virtual void neighborChanged(Level *level, int x, int y, int z, int type); - virtual void tick(Level *level, int x, int y, int z, Random *random); + virtual void tick(Level *level, int x, int y, int z, Random *random); virtual shared_ptr newTileEntity(Level *level); - virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by); - virtual void onRemove(Level *level, int x, int y, int z, int id, int data); + virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by, shared_ptr itemInstance); + virtual void onRemove(Level *level, int x, int y, int z, int id, int data); -private: - static void throwItem(Level *level, shared_ptr item, Random *random, int accuracy, int xd, int zd, double xp, double yp, double zp); - static int dispenseItem(shared_ptr trap, Level *level, shared_ptr item, Random *random, int x, int y, int z, int xd, int zd, double xp, double yp, double zp); + static Position *getDispensePosition(BlockSource *source); + static FacingEnum *getFacing(int data); + virtual bool hasAnalogOutputSignal(); + virtual int getAnalogOutputSignal(Level *level, int x, int y, int z, int dir); }; \ No newline at end of file -- cgit v1.2.3