Safe zones and faction homes :D :D
This commit is contained in:
1 parent
9d4aaeae6c
commit
b0f09db054
39 files changed
+562
-334
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package com.bukkit.mcteam.util;
|
||||
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.CreatureType;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class EntityUtil {
|
||||
public static CreatureType creatureTypeFromEntity(Entity entity) {
|
||||
if ( ! (entity instanceof Creature)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String name = entity.getClass().getSimpleName();
|
||||
name = name.substring(5); // Remove "Craft"
|
||||
|
||||
return CreatureType.fromName(name);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user