From 60cbf748d9477995561bc4f65f4103a515589b6c Mon Sep 17 00:00:00 2001 From: Sven Date: Wed, 20 May 2026 18:09:19 +0200 Subject: [PATCH] Return Material.AIR in Block.typeFast if chunk is null --- src/main/kotlin/net/trueog/antipierayog/BlockEntityHider.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/net/trueog/antipierayog/BlockEntityHider.kt b/src/main/kotlin/net/trueog/antipierayog/BlockEntityHider.kt index 380f9f2..9d5a2e7 100644 --- a/src/main/kotlin/net/trueog/antipierayog/BlockEntityHider.kt +++ b/src/main/kotlin/net/trueog/antipierayog/BlockEntityHider.kt @@ -93,7 +93,7 @@ class BlockEntityHider { get() { val craftWorld = (world as CraftWorld).handle val serverChunkCache = (craftWorld as ServerLevel).getChunkSource() - val chunk = serverChunkCache.getChunkAtIfLoadedMainThread(this.x shr 4, this.z shr 4) + val chunk = serverChunkCache.getChunkAtIfLoadedMainThread(this.x shr 4, this.z shr 4) ?: return Material.AIR val blockState = chunk.getBlockState(BlockPos(this.x, this.y, this.z)) return blockState.bukkitMaterial } -- 2.47.3