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/MultiPlayerLevel.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/MultiPlayerLevel.h')
| -rw-r--r-- | Minecraft.Client/MultiPlayerLevel.h | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/Minecraft.Client/MultiPlayerLevel.h b/Minecraft.Client/MultiPlayerLevel.h index c07b5583..6e5b0086 100644 --- a/Minecraft.Client/MultiPlayerLevel.h +++ b/Minecraft.Client/MultiPlayerLevel.h @@ -15,12 +15,12 @@ class MultiPlayerLevel : public Level private: static const int TICKS_BEFORE_RESET = 20 * 4; - class ResetInfo + class ResetInfo { public: - int x, y, z, ticks, tile, data; - ResetInfo(int x, int y, int z, int tile, int data); - }; + int x, y, z, ticks, tile, data; + ResetInfo(int x, int y, int z, int tile, int data); + }; vector<ResetInfo> updatesToReset; // 4J - was linked list but vector seems more appropriate bool m_bEnableResetChanges; // 4J Added @@ -34,50 +34,51 @@ private: int unshareCheckZ; // 4J - added int compressCheckX; // 4J - added int compressCheckZ; // 4J - added - vector<ClientConnection *> connections; // 4J Stu - Made this a vector as we can have more than one local connection - MultiPlayerChunkCache *chunkCache; + vector<ClientConnection *> connections; // 4J Stu - Made this a vector as we can have more than one local connection + MultiPlayerChunkCache *chunkCache; Minecraft *minecraft; + Scoreboard *scoreboard; public: MultiPlayerLevel(ClientConnection *connection, LevelSettings *levelSettings, int dimension, int difficulty); virtual ~MultiPlayerLevel(); - virtual void tick() ; + virtual void tick() ; void clearResetRegion(int x0, int y0, int z0, int x1, int y1, int z1); protected: - ChunkSource *createChunkSource(); // 4J - was virtual, but was called from parent ctor + ChunkSource *createChunkSource(); // 4J - was virtual, but was called from parent ctor public: virtual void validateSpawn(); protected: virtual void tickTiles(); public: - void setChunkVisible(int x, int z, bool visible); + void setChunkVisible(int x, int z, bool visible); private: unordered_map<int, shared_ptr<Entity>, IntKeyHash2, IntKeyEq> entitiesById; // 4J - was IntHashMap - unordered_set<shared_ptr<Entity> > forced; - unordered_set<shared_ptr<Entity> > reEntries; + unordered_set<shared_ptr<Entity> > forced; + unordered_set<shared_ptr<Entity> > reEntries; public: virtual bool addEntity(shared_ptr<Entity> e); - virtual void removeEntity(shared_ptr<Entity> e); + virtual void removeEntity(shared_ptr<Entity> e); protected: virtual void entityAdded(shared_ptr<Entity> e); - virtual void entityRemoved(shared_ptr<Entity> e); + virtual void entityRemoved(shared_ptr<Entity> e); public: void putEntity(int id, shared_ptr<Entity> e); - shared_ptr<Entity> getEntity(int id); - shared_ptr<Entity> removeEntity(int id); + shared_ptr<Entity> getEntity(int id); + shared_ptr<Entity> removeEntity(int id); virtual void removeEntities(vector<shared_ptr<Entity> > *list); // 4J Added override - virtual bool setDataNoUpdate(int x, int y, int z, int data); - virtual bool setTileAndDataNoUpdate(int x, int y, int z, int tile, int data); - virtual bool setTileNoUpdate(int x, int y, int z, int tile); - bool doSetTileAndData(int x, int y, int z, int tile, int data); - virtual void disconnect(bool sendDisconnect = true); + virtual bool setData(int x, int y, int z, int data, int updateFlags, bool forceUpdate =false ); + virtual bool setTileAndData(int x, int y, int z, int tile, int data, int updateFlags); + bool doSetTileAndData(int x, int y, int z, int tile, int data); + virtual void disconnect(bool sendDisconnect = true); void animateTick(int xt, int yt, int zt); protected: + virtual Tickable *makeSoundUpdater(shared_ptr<Minecart> minecart); virtual void tickWeather(); - + static const int ANIMATE_TICK_MAX_PARTICLES = 500; public: @@ -89,7 +90,11 @@ public: virtual void playSound(shared_ptr<Entity> entity, int iSound, float volume, float pitch); - virtual void playLocalSound(double x, double y, double z, int iSound, float volume, float pitch, float fClipSoundDist=16.0f); + virtual void playLocalSound(double x, double y, double z, int iSound, float volume, float pitch, bool distanceDelay = false, float fClipSoundDist = 16.0f); + + virtual void createFireworks(double x, double y, double z, double xd, double yd, double zd, CompoundTag *infoTag); + virtual void setScoreboard(Scoreboard *scoreboard); + virtual void setDayTime(__int64 newTime); // 4J Stu - Added so we can have multiple local connections void addClientConnection(ClientConnection *c) { connections.push_back( c ); } |
