From 967ffbb2a644ca962483c8dc30067dca3bdd5ae0 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:41:22 -0600 Subject: [PATCH] refactor: unglob `std::deque` --- Minecraft.Client/Network/PlayerList.h | 4 ++-- Minecraft.Client/Network/ServerChunkCache.h | 2 +- Minecraft.Client/Rendering/Particles/ParticleEngine.h | 2 +- Minecraft.World/Blocks/LiquidTileDynamic.h | 2 +- Minecraft.World/Blocks/NotGateTile.cpp | 8 ++++---- Minecraft.World/Blocks/NotGateTile.h | 2 +- Minecraft.World/Entities/Mob.h | 2 +- Minecraft.World/WorldGen/Structures/Villages.h | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Minecraft.Client/Network/PlayerList.h b/Minecraft.Client/Network/PlayerList.h index 6712a62d3..1c5bebfc5 100644 --- a/Minecraft.Client/Network/PlayerList.h +++ b/Minecraft.Client/Network/PlayerList.h @@ -30,9 +30,9 @@ private: // 4J Added std::vector m_bannedXuids; - deque m_smallIdsToKick; + std::deque m_smallIdsToKick; CRITICAL_SECTION m_kickPlayersCS; - deque m_smallIdsToClose; + std::deque m_smallIdsToClose; CRITICAL_SECTION m_closePlayersCS; /* 4J - removed Set bans = new HashSet(); diff --git a/Minecraft.Client/Network/ServerChunkCache.h b/Minecraft.Client/Network/ServerChunkCache.h index d5c5a8e2a..e5350771b 100644 --- a/Minecraft.Client/Network/ServerChunkCache.h +++ b/Minecraft.Client/Network/ServerChunkCache.h @@ -25,7 +25,7 @@ private: ServerLevel *level; #ifdef _LARGE_WORLDS - deque m_toDrop; + std::deque m_toDrop; LevelChunk **m_unloadedCache; #endif diff --git a/Minecraft.Client/Rendering/Particles/ParticleEngine.h b/Minecraft.Client/Rendering/Particles/ParticleEngine.h index 6af085fea..0d06d6590 100644 --- a/Minecraft.Client/Rendering/Particles/ParticleEngine.h +++ b/Minecraft.Client/Rendering/Particles/ParticleEngine.h @@ -26,7 +26,7 @@ public: protected: Level *level; private: - deque > particles[3][TEXTURE_COUNT]; // 4J made two arrays to cope with simultaneous two dimensions + std::deque > particles[3][TEXTURE_COUNT]; // 4J made two arrays to cope with simultaneous two dimensions Textures *textures; Random *random; diff --git a/Minecraft.World/Blocks/LiquidTileDynamic.h b/Minecraft.World/Blocks/LiquidTileDynamic.h index 51bbf1813..0aeed6319 100644 --- a/Minecraft.World/Blocks/LiquidTileDynamic.h +++ b/Minecraft.World/Blocks/LiquidTileDynamic.h @@ -18,7 +18,7 @@ private: { } } LiquidTickData; - deque m_tilesToTick; // For an iterative version of instatick + std::deque m_tilesToTick; // For an iterative version of instatick bool m_iterativeInstatick; protected: LiquidTileDynamic(int id, Material *material); diff --git a/Minecraft.World/Blocks/NotGateTile.cpp b/Minecraft.World/Blocks/NotGateTile.cpp index 6e535195d..5f90ec447 100644 --- a/Minecraft.World/Blocks/NotGateTile.cpp +++ b/Minecraft.World/Blocks/NotGateTile.cpp @@ -4,7 +4,7 @@ #include "../Util/SoundTypes.h" #include "../Headers/net.minecraft.world.h" -std::unordered_map *> NotGateTile::recentToggles = std::unordered_map *>(); +std::unordered_map *> NotGateTile::recentToggles = std::unordered_map *>(); // 4J - added, to tie in with other changes brought forward from 1.3.2 to associate toggles with a level. In addition to what the java // version does, we are also removing any references to levels that we are storing when they hit their dtor. @@ -22,7 +22,7 @@ bool NotGateTile::isToggledTooFrequently(Level *level, int x, int y, int z, bool // 4J - brought forward changes to associate toggles with a level from 1.3.2 if( recentToggles.find(level) == recentToggles.end() ) { - recentToggles[level] = new deque; + recentToggles[level] = new std::deque; } if (add) recentToggles[level]->push_back(Toggle(x, y, z, level->getTime())); int count = 0; @@ -114,7 +114,7 @@ void NotGateTile::tick(Level *level, int x, int y, int z, Random *random) // 4J - brought forward changes from 1.3.2 to associate toggles with level if( recentToggles.find(level) != recentToggles.end() ) { - deque *toggles = recentToggles[level]; + std::deque *toggles = recentToggles[level]; while (!toggles->empty() && level->getTime() - toggles->front().when > RECENT_TOGGLE_TIMER) { toggles->pop_front(); @@ -223,7 +223,7 @@ int NotGateTile::cloneTileId(Level *level, int x, int y, int z) void NotGateTile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) { - deque *toggles = recentToggles[level]; + std::deque *toggles = recentToggles[level]; if (toggles != NULL) { diff --git a/Minecraft.World/Blocks/NotGateTile.h b/Minecraft.World/Blocks/NotGateTile.h index a3f107cdb..b263d6c94 100644 --- a/Minecraft.World/Blocks/NotGateTile.h +++ b/Minecraft.World/Blocks/NotGateTile.h @@ -31,7 +31,7 @@ public: }; private: - static std::unordered_map *> recentToggles; // 4J - brought forward change from 1.3.2 + static std::unordered_map *> recentToggles; // 4J - brought forward change from 1.3.2 public: static void removeLevelReferences(Level *level); // 4J added private: diff --git a/Minecraft.World/Entities/Mob.h b/Minecraft.World/Entities/Mob.h index b47c3f264..432ede5d0 100644 --- a/Minecraft.World/Entities/Mob.h +++ b/Minecraft.World/Entities/Mob.h @@ -112,7 +112,7 @@ public: int removeArrowTime; protected: - map activeEffects; + std::map activeEffects; private: bool effectsDirty; diff --git a/Minecraft.World/WorldGen/Structures/Villages.h b/Minecraft.World/WorldGen/Structures/Villages.h index f66abae62..d0057d0a7 100644 --- a/Minecraft.World/WorldGen/Structures/Villages.h +++ b/Minecraft.World/WorldGen/Structures/Villages.h @@ -11,7 +11,7 @@ public: private: Level *level; - deque queries; + std::deque queries; std::vector > unclustered; std::vector > villages; int _tick;