diff options
Diffstat (limited to 'spark-bukkit')
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java index 8f876cf..8a4c0e4 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java @@ -27,6 +27,7 @@ import me.lucko.spark.common.platform.world.WorldInfoProvider; import org.bukkit.Chunk; import org.bukkit.Server; import org.bukkit.World; +import org.bukkit.block.BlockState; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -71,7 +72,8 @@ public class BukkitWorldInfoProvider implements WorldInfoProvider { entities += world.getEntities().size(); Chunk[] chunksArray = world.getLoadedChunks(); for (Chunk chunk : chunksArray) { - tileEntities += chunk.getTileEntities().length; + BlockState[] tileEntitiesArray = chunk.getTileEntities(); + tileEntities += tileEntitiesArray != null ? tileEntitiesArray.length : 0; } chunks += chunksArray.length; } |