mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Trim
This commit is contained in:
parent
9089bb4cdb
commit
0a689e407e
3 changed files with 21 additions and 27 deletions
|
|
@ -46,7 +46,7 @@ namespace MinecraftClient.Mapping
|
|||
{
|
||||
Tuple<int, int> chunkCoord = new(chunkX, chunkZ);
|
||||
if (value == null)
|
||||
chunks.Remove(chunkCoord, out _);
|
||||
chunks.TryRemove(chunkCoord, out _);
|
||||
else
|
||||
chunks.AddOrUpdate(chunkCoord, value, (_, _) => value);
|
||||
}
|
||||
|
|
@ -83,10 +83,16 @@ namespace MinecraftClient.Mapping
|
|||
/// <param name="loadCompleted">Whether the ChunkColumn has been fully loaded</param>
|
||||
public void StoreChunk(int chunkX, int chunkY, int chunkZ, int chunkColumnSize, Chunk? chunk, bool loadCompleted)
|
||||
{
|
||||
ChunkColumn chunkColumn = chunks.GetOrAdd(new(chunkX, chunkZ), (_) => new(chunkColumnSize));
|
||||
chunkColumn[chunkY] = chunk;
|
||||
if (loadCompleted)
|
||||
chunkColumn.FullyLoaded = true;
|
||||
Tuple<int, int> chunkCoord = new(chunkX, chunkZ);
|
||||
if (chunk == null)
|
||||
chunks.TryRemove(chunkCoord, out _);
|
||||
else
|
||||
{
|
||||
ChunkColumn chunkColumn = chunks.GetOrAdd(chunkCoord, (_) => new(chunkColumnSize));
|
||||
chunkColumn[chunkY] = chunk;
|
||||
if (loadCompleted)
|
||||
chunkColumn.FullyLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue