Program: 187491
Project: 187491
Buggy source:
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=false) public void onEntityDamageByPlayer(final EntityDamageByEntityEvent event){
  if (!(event.getEntity() instanceof CraftMyPet) && event.getDamager() instanceof Player) {
    if (MyPetType.isLeashableEntityType(event.getEntity().getType())) {
      Player damager=(Player)event.getDamager();
      if (!MyPetList.hasActiveMyPet(damager)) {
        LivingEntity leashTarget=(LivingEntity)event.getEntity();
        Class<? extends MyPet> myPetClass=MyPetType.getMyPetTypeByEntityType(leashTarget.getType()).getMyPetClass();
        ConfigItem leashItem=MyPet.getLeashItem(myPetClass);
        if (!leashItem.compare(damager.getItemInHand()) || !Permissions.has(damager,"String_Node_Str" + MyPetType.getMyPetTypeByEntityType(leashTarget.getType()).getTypeName())) {
          return;
        }
        if (Permissions.has(damager,"String_Node_Str") && PlayerList.isMyPetPlayer(damager) && PlayerList.getMyPetPlayer(damager).isCaptureHelperActive()) {
          CaptureHelper.checkTamable(leashTarget,event.getDamage(),damager);
        }
        if (PluginHookManager.isPluginUsable("String_Node_Str")) {
          try {
            if (CitizensAPI.getNPCRegistry().isNPC(leashTarget)) {
              return;
            }
          }
 catch (          Error ignored) {
          }
catch (          Exception ignored) {
          }
        }
        if (!PvPChecker.canHurt(damager,leashTarget)) {
          return;
        }
        boolean willBeLeashed=true;
        flagLoop:         for (        LeashFlag flag : MyPet.getLeashFlags(myPetClass)) {
switch (flag) {
case Adult:
            if (leashTarget instanceof Ageable) {
              willBeLeashed=((Ageable)leashTarget).isAdult();
            }
 else             if (leashTarget instanceof Zombie) {
              willBeLeashed=!((Zombie)leashTarget).isBaby();
            }
          break;
case Baby:
        if (leashTarget instanceof Ageable) {
          willBeLeashed=!((Ageable)leashTarget).isAdult();
        }
 else         if (leashTarget instanceof Zombie) {
          willBeLeashed=((Zombie)leashTarget).isBaby();
        }
      break;
case LowHp:
    willBeLeashed=((leashTarget.getHealth() - event.getDamage()) * 100) / leashTarget.getMaxHealth() <= 10;
  break;
case UserCreated:
if (leashTarget instanceof IronGolem) {
  willBeLeashed=((IronGolem)leashTarget).isPlayerCreated();
}
break;
case Wild:
if (leashTarget instanceof IronGolem) {
willBeLeashed=!((IronGolem)leashTarget).isPlayerCreated();
}
 else if (leashTarget instanceof Tameable) {
willBeLeashed=!((Tameable)leashTarget).isTamed();
}
 else if (leashTarget instanceof Horse) {
willBeLeashed=!((CraftHorse)leashTarget).getHandle().isTame();
}
break;
case Tamed:
if (leashTarget instanceof Tameable) {
willBeLeashed=((Tameable)leashTarget).isTamed();
}
if (leashTarget instanceof Horse) {
willBeLeashed=((CraftHorse)leashTarget).getHandle().isTame();
}
break;
case CanBreed:
if (leashTarget instanceof Ageable) {
willBeLeashed=((Ageable)leashTarget).canBreed();
}
break;
case Angry:
if (leashTarget instanceof Wolf) {
willBeLeashed=((Wolf)leashTarget).isAngry();
}
break;
case Impossible:
willBeLeashed=false;
break flagLoop;
case None:
willBeLeashed=true;
break flagLoop;
}
if (!willBeLeashed) {
break;
}
}
if (willBeLeashed) {
event.setCancelled(true);
MyPetPlayer owner=PlayerList.registerMyPetPlayer(damager);
InactiveMyPet inactiveMyPet=new InactiveMyPet(owner);
inactiveMyPet.setPetType(MyPetType.getMyPetTypeByEntityType(leashTarget.getType()));
inactiveMyPet.setPetName(Locales.getString("String_Node_Str" + inactiveMyPet.getPetType().getTypeName(),inactiveMyPet.getOwner().getLanguage()));
WorldGroup worldGroup=WorldGroup.getGroupByWorld(damager.getWorld().getName());
inactiveMyPet.setWorldGroup(worldGroup.getName());
inactiveMyPet.getOwner().setMyPetForWorldGroup(worldGroup.getName(),inactiveMyPet.getUUID());
TagCompound extendedInfo=new TagCompound();
if (leashTarget instanceof Ocelot) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Ocelot)leashTarget).getCatType().getId()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Ocelot)leashTarget).isSitting()));
}
 else if (leashTarget instanceof Wolf) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).isSitting()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).isTamed()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).getCollarColor().getDyeData()));
}
 else if (leashTarget instanceof Sheep) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Sheep)leashTarget).getColor().getDyeData()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Sheep)leashTarget).isSheared()));
}
 else if (leashTarget instanceof Villager) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Villager)leashTarget).getProfession().getId()));
}
 else if (leashTarget instanceof Pig) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Pig)leashTarget).hasSaddle()));
}
 else if (leashTarget instanceof Slime) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Slime)leashTarget).getSize()));
}
 else if (leashTarget instanceof Creeper) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Creeper)leashTarget).isPowered()));
}
 else if (leashTarget instanceof Horse) {
Horse horse=(Horse)leashTarget;
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte((byte)((CraftHorse)leashTarget).getHandle().getType()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().getVariant()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().cx()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(horse.isCarryingChest()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((CraftHorse)leashTarget).getHandle().cG()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().getAge()));
}
 else if (leashTarget instanceof Zombie) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Zombie)leashTarget).isBaby()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Zombie)leashTarget).isVillager()));
}
 else if (leashTarget instanceof Enderman) {
CraftEnderman enderman=(CraftEnderman)leashTarget;
if (enderman.getHandle().getCarried() != Blocks.AIR) {
net.minecraft.server.v1_8_R3.ItemStack block=new net.minecraft.server.v1_8_R3.ItemStack(enderman.getHandle().getCarried().getBlock(),1,enderman.getHandle().getCarried().getBlock().getDropData(enderman.getHandle().getCarried()));
extendedInfo.getCompoundData().put("String_Node_Str",ItemStackNBTConverter.itemStackToCompund(block));
}
}
 else if (leashTarget instanceof Skeleton) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((CraftSkeleton)leashTarget).getSkeletonType() == SkeletonType.WITHER));
}
 else if (leashTarget instanceof Guardian) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Guardian)leashTarget).isElder()));
}
 else if (leashTarget instanceof Rabbit) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(MyRabbit.RabbitType.getTypeByBukkitEnum(((Rabbit)leashTarget).getRabbitType()).getId()));
}
if (leashTarget instanceof Ageable) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(!((Ageable)leashTarget).isAdult()));
}
if (leashTarget.getWorld().getGameRuleValue("String_Node_Str").equalsIgnoreCase("String_Node_Str") && Configuration.RETAIN_EQUIPMENT_ON_TAME && (leashTarget instanceof Zombie || leashTarget instanceof PigZombie || leashTarget instanceof Skeleton)) {
Random random=((CraftLivingEntity)leashTarget).getHandle().bc();
List<TagCompound> equipmentList=new ArrayList<>();
if (random.nextFloat() <= leashTarget.getEquipment().getChestplateDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getChestplate();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Chestplate.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getHelmetDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getHelmet();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Helmet.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getLeggingsDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getLeggings();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Leggins.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getBootsDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getBoots();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Boots.getSlotId()));
equipmentList.add(item);
}
}
extendedInfo.getCompoundData().put("String_Node_Str",new TagList(equipmentList));
}
inactiveMyPet.setInfo(extendedInfo);
event.getEntity().remove();
if (Configuration.CONSUME_LEASH_ITEM && damager.getGameMode() != GameMode.CREATIVE && damager.getItemInHand() != null) {
if (damager.getItemInHand().getAmount() > 1) {
damager.getItemInHand().setAmount(damager.getItemInHand().getAmount() - 1);
}
 else {
damager.setItemInHand(null);
}
}
final MyPet myPet=MyPetList.activateMyPet(inactiveMyPet);
if (myPet != null) {
MyPetPlugin.getPlugin().getRepository().addMyPet(inactiveMyPet,new RepositoryCallback<Boolean>(){
@Override public void callback(Boolean value){
myPet.createPet();
getPluginManager().callEvent(new MyPetLeashEvent(myPet));
DebugLogger.info("String_Node_Str");
DebugLogger.info("String_Node_Str" + myPet.toString());
myPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()));
if (myPet.getOwner().isCaptureHelperActive()) {
myPet.getOwner().setCaptureHelperActive(false);
myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),Locales.getString("String_Node_Str",myPet.getOwner())));
}
}
}
);
}
}
}
}
}
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR,ignoreCancelled=false) public void onEntityDamageByPlayer(final EntityDamageByEntityEvent event){
  if (!(event.getEntity() instanceof CraftMyPet) && event.getDamager() instanceof Player) {
    if (MyPetType.isLeashableEntityType(event.getEntity().getType())) {
      Player damager=(Player)event.getDamager();
      if (!MyPetList.hasActiveMyPet(damager)) {
        LivingEntity leashTarget=(LivingEntity)event.getEntity();
        Class<? extends MyPet> myPetClass=MyPetType.getMyPetTypeByEntityType(leashTarget.getType()).getMyPetClass();
        ConfigItem leashItem=MyPet.getLeashItem(myPetClass);
        if (!leashItem.compare(damager.getItemInHand()) || !Permissions.has(damager,"String_Node_Str" + MyPetType.getMyPetTypeByEntityType(leashTarget.getType()).getTypeName())) {
          return;
        }
        if (Permissions.has(damager,"String_Node_Str") && PlayerList.isMyPetPlayer(damager) && PlayerList.getMyPetPlayer(damager).isCaptureHelperActive()) {
          CaptureHelper.checkTamable(leashTarget,event.getDamage(),damager);
        }
        if (PluginHookManager.isPluginUsable("String_Node_Str")) {
          try {
            if (CitizensAPI.getNPCRegistry().isNPC(leashTarget)) {
              return;
            }
          }
 catch (          Error ignored) {
          }
catch (          Exception ignored) {
          }
        }
        if (!PvPChecker.canHurt(damager,leashTarget)) {
          return;
        }
        boolean willBeLeashed=true;
        flagLoop:         for (        LeashFlag flag : MyPet.getLeashFlags(myPetClass)) {
switch (flag) {
case Adult:
            if (leashTarget instanceof Ageable) {
              willBeLeashed=((Ageable)leashTarget).isAdult();
            }
 else             if (leashTarget instanceof Zombie) {
              willBeLeashed=!((Zombie)leashTarget).isBaby();
            }
          break;
case Baby:
        if (leashTarget instanceof Ageable) {
          willBeLeashed=!((Ageable)leashTarget).isAdult();
        }
 else         if (leashTarget instanceof Zombie) {
          willBeLeashed=((Zombie)leashTarget).isBaby();
        }
      break;
case LowHp:
    willBeLeashed=((leashTarget.getHealth() - event.getDamage()) * 100) / leashTarget.getMaxHealth() <= 10;
  break;
case UserCreated:
if (leashTarget instanceof IronGolem) {
  willBeLeashed=((IronGolem)leashTarget).isPlayerCreated();
}
break;
case Wild:
if (leashTarget instanceof IronGolem) {
willBeLeashed=!((IronGolem)leashTarget).isPlayerCreated();
}
 else if (leashTarget instanceof Tameable) {
willBeLeashed=!((Tameable)leashTarget).isTamed();
}
 else if (leashTarget instanceof Horse) {
willBeLeashed=!((CraftHorse)leashTarget).getHandle().isTame();
}
break;
case Tamed:
if (leashTarget instanceof Tameable) {
willBeLeashed=((Tameable)leashTarget).isTamed();
}
if (leashTarget instanceof Horse) {
willBeLeashed=((CraftHorse)leashTarget).getHandle().isTame();
}
break;
case CanBreed:
if (leashTarget instanceof Ageable) {
willBeLeashed=((Ageable)leashTarget).canBreed();
}
break;
case Angry:
if (leashTarget instanceof Wolf) {
willBeLeashed=((Wolf)leashTarget).isAngry();
}
break;
case Impossible:
willBeLeashed=false;
break flagLoop;
case None:
willBeLeashed=true;
break flagLoop;
}
if (!willBeLeashed) {
break;
}
}
if (willBeLeashed) {
event.setCancelled(true);
MyPetPlayer owner;
if (PlayerList.isMyPetPlayer(damager)) {
owner=PlayerList.getMyPetPlayer(damager);
}
 else {
owner=PlayerList.registerMyPetPlayer(damager);
}
InactiveMyPet inactiveMyPet=new InactiveMyPet(owner);
inactiveMyPet.setPetType(MyPetType.getMyPetTypeByEntityType(leashTarget.getType()));
inactiveMyPet.setPetName(Locales.getString("String_Node_Str" + inactiveMyPet.getPetType().getTypeName(),inactiveMyPet.getOwner().getLanguage()));
WorldGroup worldGroup=WorldGroup.getGroupByWorld(damager.getWorld().getName());
inactiveMyPet.setWorldGroup(worldGroup.getName());
inactiveMyPet.getOwner().setMyPetForWorldGroup(worldGroup.getName(),inactiveMyPet.getUUID());
TagCompound extendedInfo=new TagCompound();
if (leashTarget instanceof Ocelot) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Ocelot)leashTarget).getCatType().getId()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Ocelot)leashTarget).isSitting()));
}
 else if (leashTarget instanceof Wolf) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).isSitting()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).isTamed()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Wolf)leashTarget).getCollarColor().getDyeData()));
}
 else if (leashTarget instanceof Sheep) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Sheep)leashTarget).getColor().getDyeData()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Sheep)leashTarget).isSheared()));
}
 else if (leashTarget instanceof Villager) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Villager)leashTarget).getProfession().getId()));
}
 else if (leashTarget instanceof Pig) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Pig)leashTarget).hasSaddle()));
}
 else if (leashTarget instanceof Slime) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((Slime)leashTarget).getSize()));
}
 else if (leashTarget instanceof Creeper) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Creeper)leashTarget).isPowered()));
}
 else if (leashTarget instanceof Horse) {
Horse horse=(Horse)leashTarget;
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte((byte)((CraftHorse)leashTarget).getHandle().getType()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().getVariant()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().cx()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(horse.isCarryingChest()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((CraftHorse)leashTarget).getHandle().cG()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagInt(((CraftHorse)leashTarget).getHandle().getAge()));
}
 else if (leashTarget instanceof Zombie) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Zombie)leashTarget).isBaby()));
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Zombie)leashTarget).isVillager()));
}
 else if (leashTarget instanceof Enderman) {
CraftEnderman enderman=(CraftEnderman)leashTarget;
if (enderman.getHandle().getCarried() != Blocks.AIR) {
net.minecraft.server.v1_8_R3.ItemStack block=new net.minecraft.server.v1_8_R3.ItemStack(enderman.getHandle().getCarried().getBlock(),1,enderman.getHandle().getCarried().getBlock().getDropData(enderman.getHandle().getCarried()));
extendedInfo.getCompoundData().put("String_Node_Str",ItemStackNBTConverter.itemStackToCompund(block));
}
}
 else if (leashTarget instanceof Skeleton) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((CraftSkeleton)leashTarget).getSkeletonType() == SkeletonType.WITHER));
}
 else if (leashTarget instanceof Guardian) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(((Guardian)leashTarget).isElder()));
}
 else if (leashTarget instanceof Rabbit) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(MyRabbit.RabbitType.getTypeByBukkitEnum(((Rabbit)leashTarget).getRabbitType()).getId()));
}
if (leashTarget instanceof Ageable) {
extendedInfo.getCompoundData().put("String_Node_Str",new TagByte(!((Ageable)leashTarget).isAdult()));
}
if (leashTarget.getWorld().getGameRuleValue("String_Node_Str").equalsIgnoreCase("String_Node_Str") && Configuration.RETAIN_EQUIPMENT_ON_TAME && (leashTarget instanceof Zombie || leashTarget instanceof PigZombie || leashTarget instanceof Skeleton)) {
Random random=((CraftLivingEntity)leashTarget).getHandle().bc();
List<TagCompound> equipmentList=new ArrayList<>();
if (random.nextFloat() <= leashTarget.getEquipment().getChestplateDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getChestplate();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Chestplate.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getHelmetDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getHelmet();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Helmet.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getLeggingsDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getLeggings();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Leggins.getSlotId()));
equipmentList.add(item);
}
}
if (random.nextFloat() <= leashTarget.getEquipment().getBootsDropChance()) {
ItemStack itemStack=leashTarget.getEquipment().getBoots();
if (itemStack != null && itemStack.getType() != Material.AIR) {
net.minecraft.server.v1_8_R3.ItemStack nmsItemStack=CraftItemStack.asNMSCopy(itemStack);
TagCompound item=ItemStackNBTConverter.itemStackToCompund(nmsItemStack);
item.getCompoundData().put("String_Node_Str",new TagInt(EquipmentSlot.Boots.getSlotId()));
equipmentList.add(item);
}
}
extendedInfo.getCompoundData().put("String_Node_Str",new TagList(equipmentList));
}
inactiveMyPet.setInfo(extendedInfo);
event.getEntity().remove();
if (Configuration.CONSUME_LEASH_ITEM && damager.getGameMode() != GameMode.CREATIVE && damager.getItemInHand() != null) {
if (damager.getItemInHand().getAmount() > 1) {
damager.getItemInHand().setAmount(damager.getItemInHand().getAmount() - 1);
}
 else {
damager.setItemInHand(null);
}
}
final MyPet myPet=MyPetList.activateMyPet(inactiveMyPet);
if (myPet != null) {
MyPetPlugin.getPlugin().getRepository().addMyPet(inactiveMyPet,new RepositoryCallback<Boolean>(){
@Override public void callback(Boolean value){
myPet.createPet();
getPluginManager().callEvent(new MyPetLeashEvent(myPet));
DebugLogger.info("String_Node_Str");
DebugLogger.info("String_Node_Str" + myPet.toString());
myPet.sendMessageToOwner(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()));
if (myPet.getOwner().isCaptureHelperActive()) {
myPet.getOwner().setCaptureHelperActive(false);
myPet.sendMessageToOwner(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner()),Locales.getString("String_Node_Str",myPet.getOwner())));
}
}
}
);
}
}
}
}
}
}