From 119bff351450ea16ffda550b6e0f67379b29f708 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:37:16 +0700 Subject: Revert "shared_ptr -> std::shared_ptr" This reverts commit 7074f35e4ba831e358117842b99ee35b87f85ae5. --- Minecraft.Client/PlayerChunkMap.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Minecraft.Client/PlayerChunkMap.h') diff --git a/Minecraft.Client/PlayerChunkMap.h b/Minecraft.Client/PlayerChunkMap.h index 5e87934b..08cda2a7 100644 --- a/Minecraft.Client/PlayerChunkMap.h +++ b/Minecraft.Client/PlayerChunkMap.h @@ -25,8 +25,8 @@ public: { public: int x,z; - std::shared_ptr player; - PlayerChunkAddRequest(int x, int z, std::shared_ptr player ) : x(x), z(z), player(player) {} + shared_ptr player; + PlayerChunkAddRequest(int x, int z, shared_ptr player ) : x(x), z(z), player(player) {} }; class PlayerChunk @@ -34,7 +34,7 @@ public: friend class PlayerChunkMap; private: PlayerChunkMap *parent; // 4J added - vector > players; + vector > players; //int x, z; ChunkPos pos; @@ -51,25 +51,25 @@ public: ~PlayerChunk(); // 4J Added sendPacket param so we can aggregate the initial send into one much smaller packet - void add(std::shared_ptr player, bool sendPacket = true); - void remove(std::shared_ptr player); + void add(shared_ptr player, bool sendPacket = true); + void remove(shared_ptr player); void tileChanged(int x, int y, int z); void prioritiseTileChanges(); // 4J added - void broadcast(std::shared_ptr packet); + void broadcast(shared_ptr packet); bool broadcastChanges(bool allowRegionUpdate); // 4J - added parm private: - void broadcast(std::shared_ptr te); + void broadcast(shared_ptr te); }; public: - vector > players; + vector > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: unordered_map chunks; // 4J - was LongHashMap vector changedChunks; vector addRequests; // 4J added - void tickAddRequests(std::shared_ptr player); // 4J added + void tickAddRequests(shared_ptr player); // 4J added ServerLevel *level; int radius; @@ -83,21 +83,21 @@ public: bool hasChunk(int x, int z); private: PlayerChunk *getChunk(int x, int z, bool create); - void getChunkAndAddPlayer(int x, int z, std::shared_ptr player); // 4J added - void getChunkAndRemovePlayer(int x, int z, std::shared_ptr player); // 4J added + void getChunkAndAddPlayer(int x, int z, shared_ptr player); // 4J added + void getChunkAndRemovePlayer(int x, int z, shared_ptr player); // 4J added public: - void broadcastTileUpdate(std::shared_ptr packet, int x, int y, int z); + void broadcastTileUpdate(shared_ptr packet, int x, int y, int z); void tileChanged(int x, int y, int z); bool isTrackingTile(int x, int y, int z); // 4J added void prioritiseTileChanges(int x, int y, int z); // 4J added - void add(std::shared_ptr player); - void remove(std::shared_ptr player); + void add(shared_ptr player); + void remove(shared_ptr player); private: bool chunkInRange(int x, int z, int xc, int zc); public: - void move(std::shared_ptr player); + void move(shared_ptr player); int getMaxRange(); - bool isPlayerIn(std::shared_ptr player, int xChunk, int zChunk); + bool isPlayerIn(shared_ptr player, int xChunk, int zChunk); static int convertChunkRangeToBlock(int radius); // AP added for Vita -- cgit v1.2.3