Return Material.AIR in Block.typeFast if chunk is null #9

Merged
SKBotNL merged 1 commits from main into main 2026-05-20 12:10:56 -04:00
@@ -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
}