Program: 39450
Project: 39450
Buggy source:
public boolean processInteract(EntityPlayer player,EnumHand hand,ItemStack stack){
  if (this.isTamed()) {
    if (!stack.isEmpty()) {
      if (this.isHealingItem(stack)) {
        if (!player.capabilities.isCreativeMode) {
          stack.shrink(1);
        }
        this.playHealEffect();
        this.heal(20f);
        return true;
      }
      if (this.isOwner(player)) {
        if (!player.capabilities.isCreativeMode) {
          stack.shrink(1);
        }
        if (!this.getHeldItemMainhand().isEmpty() && !getEntityWorld().isRemote) {
          this.dropItemStack(this.getHeldItemMainhand(),0.0f);
        }
        ItemStack newStack=new ItemStack(stack.getItem(),1,stack.getMetadata());
        if (getEntityWorld().isRemote && PrimitiveMobsConfigMobs.getDebug()) {
          String[] divided=stack.getItem().getRegistryName().toString().split("String_Node_Str");
          Minecraft.getMinecraft().player.sendChatMessage("String_Node_Str" + divided[0] + "String_Node_Str"+ divided[1]+ "String_Node_Str"+ stack.getMetadata());
        }
        this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,newStack);
      }
    }
 else     if (stack.isEmpty() && this.isOwner(player)) {
      if (!getEntityWorld().isRemote) {
        this.aiSit.setSitting(!this.isSitting());
        this.isJumping=false;
        this.navigator.clearPathEntity();
      }
 else {
        this.playSitEffect();
      }
    }
  }
 else   if (!stack.isEmpty() && this.isTamingItem(stack) && this.getHeldItemMainhand().isEmpty()) {
    if (!player.capabilities.isCreativeMode) {
      stack.shrink(1);
    }
    if (!this.getEntityWorld().isRemote) {
      this.setTamed(true);
      this.navigator.clearPathEntity();
      this.setHealth(20.0F);
      this.setOwnerId(player.getUniqueID());
      this.playTameEffect(true);
      this.getEntityWorld().setEntityState(this,(byte)7);
    }
    return true;
  }
  return super.processInteract(player,hand);
}

Fixed version (ground truth):
public boolean processInteract(EntityPlayer player,EnumHand hand,ItemStack stack){
  if (this.isTamed()) {
    if (!stack.isEmpty()) {
      if (this.isHealingItem(stack)) {
        if (!player.capabilities.isCreativeMode) {
          stack.shrink(1);
        }
        this.playHealEffect();
        this.heal(20f);
        return true;
      }
      if (this.isOwner(player)) {
        if (!player.capabilities.isCreativeMode) {
          stack.shrink(1);
        }
        if (!this.getHeldItemMainhand().isEmpty() && !getEntityWorld().isRemote) {
          this.dropItemStack(this.getHeldItemMainhand(),0.0f);
        }
        ItemStack newStack=new ItemStack(stack.getItem(),1,stack.getMetadata());
        this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND,newStack);
      }
    }
 else     if (stack.isEmpty() && this.isOwner(player)) {
      if (!getEntityWorld().isRemote) {
        this.aiSit.setSitting(!this.isSitting());
        this.isJumping=false;
        this.navigator.clearPathEntity();
      }
 else {
        this.playSitEffect();
      }
    }
  }
 else   if (!stack.isEmpty() && this.isTamingItem(stack) && this.getHeldItemMainhand().isEmpty()) {
    if (!player.capabilities.isCreativeMode) {
      stack.shrink(1);
    }
    if (!this.getEntityWorld().isRemote) {
      this.setTamed(true);
      this.navigator.clearPathEntity();
      this.setHealth(20.0F);
      this.setOwnerId(player.getUniqueID());
      this.playTameEffect(true);
      this.getEntityWorld().setEntityState(this,(byte)7);
    }
    return true;
  }
  return super.processInteract(player,hand);
}