Fixed ArrayIndexOutOfBoundsException when placing or breaking a block close to max / min InstanceContainer height (#569)

This commit is contained in:
Mrln 2022-01-02 07:17:36 +01:00 committed by TheMode
parent 627bc14b56
commit dcc079ed9c

View File

@ -493,6 +493,8 @@ public class InstanceContainer extends Instance {
final int neighborX = blockPosition.blockX() + offsetX; final int neighborX = blockPosition.blockX() + offsetX;
final int neighborY = blockPosition.blockY() + offsetY; final int neighborY = blockPosition.blockY() + offsetY;
final int neighborZ = blockPosition.blockZ() + offsetZ; final int neighborZ = blockPosition.blockZ() + offsetZ;
if (neighborY < getDimensionType().getMinY() || neighborY > getDimensionType().getTotalHeight())
continue;
final Chunk chunk = getChunkAt(neighborX, neighborZ); final Chunk chunk = getChunkAt(neighborX, neighborZ);
if (chunk == null) continue; if (chunk == null) continue;