Reducing CPU usage on chunk load.

This commit is contained in:
Glitchfinder 2013-01-18 14:55:29 -08:00
parent 50de88a0a0
commit 00f24fd5bd

View File

@ -17,6 +17,7 @@ import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.FallingBlock;
import org.bukkit.entity.LivingEntity;
import com.gmail.nossr50.runnables.blockstoreconversion.BlockStoreConversionZDirectory;
@ -179,7 +180,12 @@ public class HashChunkManager implements ChunkManager {
iteratingMobs = true;
for (Entity entity : world.getEntities()) {
for (LivingEntity entity : world.getLivingEntities()) {
if (mobs.contains(entity.getUniqueId()))
addSpawnedMob(entity);
}
for(FallingBlock entity: world.getEntitiesByClass(FallingBlock.class)) {
if (mobs.contains(entity.getUniqueId()))
addSpawnedMob(entity);
}