Esempio n. 1
0
 @Override
 public Message[] getSpawnMessage(Entity entity) {
   Controller c = entity.getController();
   if (c != null) {
     int id = entity.getId();
     Vector3 pos = entity.getPosition().multiply(32).floor();
     int r = (int) (entity.getYaw() * 32);
     int p = (int) (entity.getPitch() * 32);
     int headyaw = 0;
     if (c instanceof Living) {
       headyaw = ((Living) c).getHeadYaw();
     }
     List<Parameter<?>> parameters = this.getSpawnParameters(c);
     return new Message[] {
       new SpawnMobMessage(id, this.getSpawnID(), pos, r, p, headyaw, parameters)
     };
   } else {
     return null;
   }
 }