Esempio n. 1
0
 public EntityPet(World world, Pet pet) {
   super(world);
   try {
     pet.setCraftPet(new CraftPet(world.getServer(), this));
     // pet.setCraftPet(pet.getPetType().getNewCraftInstance(this));
     // setPet(pet);
     this.pet = pet;
     ((LivingEntity) this.getBukkitEntity()).setMaxHealth(pet.getPetType().getMaxHealth());
     this.setHealth(pet.getPetType().getMaxHealth());
     this.jumpHeight =
         EchoPet.getPluginInstance().DO.getRideJumpHeight(this.getPet().getPetType());
     this.rideSpeed = EchoPet.getPluginInstance().DO.getRideSpeed(this.getPet().getPetType());
     this.jump = EntityLiving.class.getDeclaredField("bd");
     this.jump.setAccessible(true);
     setPathfinding();
   } catch (Exception e) {
     EchoPet.getPluginInstance().severe(e, "Error creating new pet entity.");
     this.remove();
   }
 }
Esempio n. 2
0
 public Player getOwner() {
   return pet.getOwner();
 }