Merge pull request #3098 from MCCTeam/copilot/bugfix-out-of-bounds-exception

This commit is contained in:
Anon 2026-05-07 00:10:23 +02:00 committed by GitHub
commit 6673b398b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -437,7 +437,7 @@ namespace MinecraftClient.Mapping
public void SetBlock(Location location, Block block)
{
ChunkColumn? column = this[location.ChunkX, location.ChunkZ];
if (column is not null && column.ColumnSize >= location.ChunkY)
if (column is not null && location.ChunkY >= 0 && location.ChunkY < column.ColumnSize)
{
Chunk? chunk = column.GetChunk(location);
if (chunk is null)