mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix index out of bound when height < 0 or > 255
Bug report by TNTUP, see #173
This commit is contained in:
parent
b83985c9fa
commit
b99edee642
1 changed files with 8 additions and 1 deletions
|
|
@ -42,7 +42,14 @@ namespace MinecraftClient.Mapping
|
||||||
/// <returns>The chunk, or null if not loaded</returns>
|
/// <returns>The chunk, or null if not loaded</returns>
|
||||||
public Chunk GetChunk(Location location)
|
public Chunk GetChunk(Location location)
|
||||||
{
|
{
|
||||||
return this[location.ChunkY];
|
try
|
||||||
|
{
|
||||||
|
return this[location.ChunkY];
|
||||||
|
}
|
||||||
|
catch (IndexOutOfRangeException)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue