aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/MultiPlayerChunkCache.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-16 21:44:26 -0500
committerGitHub <noreply@github.com>2026-03-16 21:44:26 -0500
commitce739f6045ec72127491286ea3f3f21e537c1b55 (patch)
treef33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.Client/MultiPlayerChunkCache.cpp
parent255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff)
parent5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.Client/MultiPlayerChunkCache.cpp')
-rw-r--r--Minecraft.Client/MultiPlayerChunkCache.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Minecraft.Client/MultiPlayerChunkCache.cpp b/Minecraft.Client/MultiPlayerChunkCache.cpp
index a4c200be..62361ce3 100644
--- a/Minecraft.Client/MultiPlayerChunkCache.cpp
+++ b/Minecraft.Client/MultiPlayerChunkCache.cpp
@@ -65,7 +65,7 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level)
{
if( y >= 3 )
{
- ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15);
+ static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15);
}
}
}
@@ -77,18 +77,18 @@ MultiPlayerChunkCache::MultiPlayerChunkCache(Level *level)
{
if( y >= ( level->getSeaLevel() - 1 ) )
{
- ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15);
+ static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,15);
}
else
{
- ((WaterLevelChunk *)waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,2);
+ static_cast<WaterLevelChunk *>(waterChunk)->setLevelChunkBrightness(LightLayer::Sky,x,y,z,2);
}
}
}
}
else
{
- waterChunk = NULL;
+ waterChunk = nullptr;
}
this->level = level;
@@ -132,7 +132,7 @@ bool MultiPlayerChunkCache::reallyHasChunk(int x, int z)
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
- if( chunk == NULL )
+ if( chunk == nullptr )
{
return false;
}
@@ -166,7 +166,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
LevelChunk *chunk = cache[idx];
LevelChunk *lastChunk = chunk;
- if( chunk == NULL )
+ if( chunk == nullptr )
{
EnterCriticalSection(&m_csLoadCreate);
@@ -174,7 +174,7 @@ LevelChunk *MultiPlayerChunkCache::create(int x, int z)
if( g_NetworkManager.IsHost() ) // force here to disable sharing of data
{
// 4J-JEV: We are about to use shared data, abort if the server is stopped and the data is deleted.
- if (MinecraftServer::getInstance()->serverHalted()) return NULL;
+ if (MinecraftServer::getInstance()->serverHalted()) return nullptr;
// If we're the host, then don't create the chunk, share data from the server's copy
#ifdef _LARGE_WORLDS
@@ -248,7 +248,7 @@ LevelChunk *MultiPlayerChunkCache::getChunk(int x, int z)
int idx = ix * XZSIZE + iz;
LevelChunk *chunk = cache[idx];
- if( chunk == NULL )
+ if( chunk == nullptr )
{
return emptyChunk;
}
@@ -279,12 +279,12 @@ void MultiPlayerChunkCache::postProcess(ChunkSource *parent, int x, int z)
vector<Biome::MobSpawnerData *> *MultiPlayerChunkCache::getMobsAt(MobCategory *mobCategory, int x, int y, int z)
{
- return NULL;
+ return nullptr;
}
TilePos *MultiPlayerChunkCache::findNearestMapFeature(Level *level, const wstring &featureName, int x, int y, int z)
{
- return NULL;
+ return nullptr;
}
void MultiPlayerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chunkZ)
@@ -294,7 +294,7 @@ void MultiPlayerChunkCache::recreateLogicStructuresForChunk(int chunkX, int chun
wstring MultiPlayerChunkCache::gatherStats()
{
EnterCriticalSection(&m_csLoadCreate);
- int size = (int)loadedChunkList.size();
+ int size = static_cast<int>(loadedChunkList.size());
LeaveCriticalSection(&m_csLoadCreate);
return L"MultiplayerChunkCache: " + std::to_wstring(size);