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.Client/ServerLevel.h | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'Minecraft.Client/ServerLevel.h') diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index 644c15c0..45f3114d 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -11,7 +11,7 @@ using namespace std; class ServerLevel : public Level { private: - static const int EMPTY_TIME_NO_TICK = SharedConstants::TICKS_PER_SECOND * 3; + static const int EMPTY_TIME_NO_TICK = SharedConstants::TICKS_PER_SECOND * 60; MinecraftServer *server; EntityTracker *tracker; @@ -29,10 +29,12 @@ protected: public: ServerChunkCache *cache; - bool canEditSpawn; - bool noSave; + bool canEditSpawn; + bool noSave; private: bool allPlayersSleeping; + PortalForcer *portalForcer; + MobSpawner *mobSpawner; int emptyTime; bool m_bAtLeastOnePlayerSleeping; // 4J Added static WeighedTreasureArray RANDOM_BONUS_ITEMS; // 4J - brought forward from 1.3.2 @@ -59,21 +61,27 @@ public: protected: void tickTiles(); +private: + vector toBeTicked; + public: + bool isTileToBeTickedAt(int x, int y, int z, int tileId); void addToTickNextTick(int x, int y, int z, int tileId, int tickDelay); - void forceAddTileTick(int x, int y, int z, int tileId, int tickDelay); + void addToTickNextTick(int x, int y, int z, int tileId, int tickDelay, int priorityTilt); + void forceAddTileTick(int x, int y, int z, int tileId, int tickDelay, int prioTilt); void tickEntities(); + void resetEmptyTime(); bool tickPendingTicks(bool force); vector *fetchTicksInChunk(LevelChunk *chunk, bool remove); - virtual void tick(shared_ptr e, bool actual); - void forceTick(shared_ptr e, bool actual); + virtual void tick(shared_ptr e, bool actual); + void forceTick(shared_ptr e, bool actual); bool AllPlayersAreSleeping() { return allPlayersSleeping;} // 4J added for a message to other players bool isAtLeastOnePlayerSleeping() { return m_bAtLeastOnePlayerSleeping;} protected: ChunkSource *createChunkSource(); // 4J - was virtual, but was called from parent ctor public: vector > *getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1); - virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int id); + virtual bool mayInteract(shared_ptr player, int xt, int yt, int zt, int content); protected: virtual void initializeLevel(LevelSettings *settings); virtual void setInitialSpawn(LevelSettings *settings); @@ -94,20 +102,20 @@ private: intEntityMap entitiesById; // 4J - was IntHashMap, using same hashing function as this uses protected: virtual void entityAdded(shared_ptr e); - virtual void entityRemoved(shared_ptr e); + virtual void entityRemoved(shared_ptr e); public: shared_ptr getEntity(int id); - virtual bool addGlobalEntity(shared_ptr e); - void broadcastEntityEvent(shared_ptr e, byte event); - virtual shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); - virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); + virtual bool addGlobalEntity(shared_ptr e); + void broadcastEntityEvent(shared_ptr e, byte event); + virtual shared_ptr explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks); + virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1); private: void runTileEvents(); bool doTileEvent(TileEventData *te); public: - void closeLevelStorage(); + void closeLevelStorage(); protected: virtual void tickWeather(); @@ -116,6 +124,9 @@ public: EntityTracker *getTracker(); void setTimeAndAdjustTileTicks(__int64 newTime); PlayerChunkMap *getChunkMap(); + PortalForcer *getPortalForcer(); + void sendParticles(const wstring &name, double x, double y, double z, int count); + void sendParticles(const wstring &name, double x, double y, double z, int count, double xDist, double yDist, double zDist, double speed); void queueSendTileUpdate(int x, int y, int z); // 4J Added private: @@ -142,7 +153,9 @@ public: virtual bool addEntity(shared_ptr e); void entityAddedExtra(shared_ptr e); void entityRemovedExtra(shared_ptr e); - + + bool atEntityLimit(shared_ptr e); // 4J: Added + virtual bool newPrimedTntAllowed(); virtual bool newFallingTileAllowed(); -- cgit v1.2.3