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 }