Use the fromstring in entity type

This commit is contained in:
Eric Stokes 2012-03-10 10:29:32 -07:00
parent dcc6b828a8
commit 5be6ea2766
1 changed files with 3 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Animals;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Slime;
@ -105,7 +106,8 @@ public class SimpleWorldPurger implements WorldPurger {
negate = negateMonsters;
}
for (String s : thingsToKill) {
if (e.getType().getName() != null && e.getType().getName().equalsIgnoreCase(s)) {
EntityType type = EntityType.fromName(s);
if (type != null && type.equals(e.getType())) {
specified = true;
if (!negate) {
this.plugin.log(Level.FINEST, "Removing an entity because it WAS specified and we are NOT negating: " + e);