Get rid of old CB refference trick to get creature type.

This commit is contained in:
Olof Larsson
2013-04-10 09:44:15 +02:00
parent 57f5372d43
commit d2e261a275
2 changed files with 3 additions and 18 deletions

View File

@ -4,25 +4,9 @@ import java.util.Arrays;
import java.util.HashSet;
import org.bukkit.ChatColor;
import org.bukkit.entity.Creature;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Entity;
public class MiscUtil
{
public static EntityType creatureTypeFromEntity(Entity entity)
{
if ( ! (entity instanceof Creature))
{
return null;
}
String name = entity.getClass().getSimpleName();
name = name.substring(5); // Remove "Craft"
return EntityType.fromName(name);
}
// Inclusive range
public static long[] range(long start, long end) {
long[] values = new long[(int) Math.abs(end - start) + 1];