/*
   * Villager specific methods
   */
  public static Villager SpawnVillager(World world, Location loc, String name) {
    if (EpicSystem.useCitizens()) return null;

    // Check if villager exists
    if (GetEntity(world, name) != null) {
      RemoveVillager(world, name);
    }

    // Set properties
    Villager villager = (Villager) world.spawnEntity(loc, EntityType.VILLAGER);
    villager.setCustomName(name);
    villager.setCustomNameVisible(true);
    villager.setAgeLock(true);
    villager.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1000000000, 100000000));
    villager.setCanPickupItems(false);

    QuestEntity epicVillager = new QuestEntity(villager);
    epicVillager.originalLocation = loc;

    entityList.put(villager, epicVillager);

    return villager;
  }
Example #2
0
 public String toString() {
   return QuestEntity.zzb(this);
 }
Example #3
0
 public boolean equals(Object obj) {
   return QuestEntity.zza(this, obj);
 }
Example #4
0
 public int hashCode() {
   return QuestEntity.zza(this);
 }