From 4b479af96fed42eecd1874a9a5f753789cc67963 Mon Sep 17 00:00:00 2001 From: Krxwallo <59575572+Krxwallo@users.noreply.github.com> Date: Mon, 21 Feb 2022 16:11:51 +0100 Subject: [PATCH] fix Chunk.allBlocks height (#39) Fixes Chunk.allBlocks crashing when using it in the nether. --- .../kotlin/net/axay/kspigot/extensions/bukkit/GeoExtensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/net/axay/kspigot/extensions/bukkit/GeoExtensions.kt b/src/main/kotlin/net/axay/kspigot/extensions/bukkit/GeoExtensions.kt index 7e978fdd..1c6214a3 100644 --- a/src/main/kotlin/net/axay/kspigot/extensions/bukkit/GeoExtensions.kt +++ b/src/main/kotlin/net/axay/kspigot/extensions/bukkit/GeoExtensions.kt @@ -18,7 +18,7 @@ val Location.worldOrException: World */ val Chunk.allBlocks get() = LinkedHashSet().apply { - for (y in -64 until 320) { + for (y in world.minHeight until world.maxHeight) { for (x in 0 until 16) for (z in 0 until 16) add(getBlock(x, y, z))