diff options
| author | daoge <3523206925@qq.com> | 2026-03-03 03:04:10 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-03 03:04:10 +0800 |
| commit | b3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch) | |
| tree | 267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/ServerLevel.h | |
| parent | 84c31a2331f7a0ec85b9d438992e244f60e5020f (diff) | |
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 <lokirautio@gmail.com>
Diffstat (limited to 'Minecraft.Client/ServerLevel.h')
| -rw-r--r-- | Minecraft.Client/ServerLevel.h | 41 |
1 files changed, 27 insertions, 14 deletions
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<TickNextTickData> 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<TickNextTickData> *fetchTicksInChunk(LevelChunk *chunk, bool remove); - virtual void tick(shared_ptr<Entity> e, bool actual); - void forceTick(shared_ptr<Entity> e, bool actual); + virtual void tick(shared_ptr<Entity> e, bool actual); + void forceTick(shared_ptr<Entity> 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<shared_ptr<TileEntity> > *getTileEntitiesInRegion(int x0, int y0, int z0, int x1, int y1, int z1); - virtual bool mayInteract(shared_ptr<Player> player, int xt, int yt, int zt, int id); + virtual bool mayInteract(shared_ptr<Player> 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<Entity> e); - virtual void entityRemoved(shared_ptr<Entity> e); + virtual void entityRemoved(shared_ptr<Entity> e); public: shared_ptr<Entity> getEntity(int id); - virtual bool addGlobalEntity(shared_ptr<Entity> e); - void broadcastEntityEvent(shared_ptr<Entity> e, byte event); - virtual shared_ptr<Explosion> explode(shared_ptr<Entity> 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<Entity> e); + void broadcastEntityEvent(shared_ptr<Entity> e, byte event); + virtual shared_ptr<Explosion> explode(shared_ptr<Entity> 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<Entity> e); void entityAddedExtra(shared_ptr<Entity> e); void entityRemovedExtra(shared_ptr<Entity> e); - + + bool atEntityLimit(shared_ptr<Entity> e); // 4J: Added + virtual bool newPrimedTntAllowed(); virtual bool newFallingTileAllowed(); |
