Clean up sewer mobs
This commit is contained in:
parent
074c786c35
commit
0fa0d88aac
@ -1,6 +1,7 @@
|
||||
package mineplex.gemhunters.world;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -44,6 +45,17 @@ public class SewerMobs implements Listener
|
||||
}
|
||||
|
||||
World world = Bukkit.getWorlds().get(0);
|
||||
Iterator<Entity> iterator= _entities.iterator();
|
||||
|
||||
while (iterator.hasNext())
|
||||
{
|
||||
Entity entity = iterator.next();
|
||||
|
||||
if (entity.isDead() || !entity.isValid())
|
||||
{
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_MOBS / 4; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user