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
|
|
@ -41,8 +41,15 @@ namespace MinecraftClient.Mapping
|
|||
/// <param name="location">Location, a modulo will be applied</param>
|
||||
/// <returns>The chunk, or null if not loaded</returns>
|
||||
public Chunk GetChunk(Location location)
|
||||
{
|
||||
try
|
||||
{
|
||||
return this[location.ChunkY];
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue