예제 #1
0
 public EventTracker(EntityVillager villager) {
   this(
       villager.getEntityId(),
       villager.getPosition(),
       villager.getCustomNameTag(),
       new Object[] {villager.getProfession(), villager.isChild()});
 }
 @Override
 public void process(List<String> list, Entity entity) {
   if (entity instanceof EntityVillager) {
     EntityVillager villager = (EntityVillager) entity;
     switch (villager.getProfession()) {
       case 0:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession_0"));
         break;
       case 1:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession_1"));
         break;
       case 2:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession_2"));
         break;
       case 3:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession_3"));
         break;
       case 4:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession_4"));
         break;
       default:
         list.add(StatCollector.translateToLocal("smartcursor.mob.profession"));
         break;
     }
     if (villager.isTrading()) list.add(StatCollector.translateToLocal("smartcursor.mob.trade"));
   }
 }