public abstract class StigglesNPC {
private NPC npc;
private ChatColor nameColorPrefix = ChatColor.WHITE;
private ChatColor chatColor = ChatColor.WHITE;
protected SMP5 main;
private String name;
private com.stiggles.smp5.worlds.WorldType worldType;
private String worldName;
private Location spawnLocation;
private float yaw;
private float pitch;
public StigglesNPC (SMP5 main, String name, Location location) {
this.main = main;
npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, name);
NPCManager.registerNewNPC(this);
worldName = location.getWorld().getName();
worldType = com.stiggles.smp5.worlds.WorldType.SMP;
for (com.stiggles.smp5.worlds.WorldType w : WorldType.values())
if (worldName.contains(w.toString()))
worldType = w;
spawnLocation = location;
yaw = 1f;
pitch = 1f;
npc.spawn(spawnLocation);
}
/** Set the skin of the NPC. Get fields from mineskin.org.
*
* @param value The skin value string.
* @param signature The skin signature string.
*/
public void setSkin (String value, String signature) {
npc.getOrAddTrait(SkinTrait.class).setSkinPersistent(name, signature, value);
}
}