Пример #1
0
 /// <summary>
 /// Rebuilds the given instance's minecraft.jar
 /// </summary>
 private Modder RebuildMCJar(Instance inst)
 {
     if (!File.Exists(SelectedInst.MCJar))
     {
         MessageUtils.ShowMessageBox(MessageType.Warning,
                                     "You must run the " +
                                     "instance at least " +
                                     "once before installing mods.");
         return null;
     }
     Modder modder = new Modder(inst);
     modder.Completed += (sender, e) => inst.NeedsRebuild = false;
     StartTask(modder);
     return modder;
 }
Пример #2
0
        /// <summary>
        /// Rebuilds the given instance's minecraft.jar
        /// </summary>
        private Modder RebuildMCJar(Instance inst)
        {
            if (!File.Exists(inst.MCJar))
            {
                MessageDialog.Show(MainWindow,
                                "You must run the " +
                                "instance at least " +
                                "once before installing mods.",
                                "Error");
                return null;
            }

            string instVersion = inst.Version;
            Console.WriteLine("Checking mod versions for minecraft {0} instance.",
                instVersion);
            foreach (Mod mod in inst.InstMods)
            {
                string modVersion = null;
                if (mod.MCVersion != null)
                    modVersion = MCVersionMap.VersionMap[mod.MCVersion];

                if (string.IsNullOrEmpty(modVersion))
                {
                    if (!string.IsNullOrEmpty(mod.MCVersion))
                    {
                        Console.WriteLine("Unknown Minecraft version: {0}", mod.MCVersion);
                    }

                    continue;
                }
                else if (modVersion != instVersion)
                {
                    DialogResponse response = MessageDialog.Show(MainWindow,
                        string.Format("One of your mods ({0} for Minecraft {1}) " +
                            "is not compatible with " +
                            "this version of minecraft.\n" +
                            "Continue installing it?",
                            mod.Name, mod.MCVersion),
                            "Warning", MessageButtons.OkCancel);

                    if (response == DialogResponse.Cancel)
                    {
                        return null;
                    }
                }
            }

            Modder modder = new Modder(inst);
            modder.Completed += (sender, e) => inst.NeedsRebuild = false;
            StartTask(modder);
            return modder;
        }
Пример #3
0
 /// <summary>
 /// Rebuilds the given instance's minecraft.jar
 /// </summary>
 private void RebuildMCJar(Instance inst)
 {
     if (!File.Exists(SelectedInst.MCJar))
     {
         MessageUtils.ShowMessageBox(MessageType.Warning,
                                     "You must run the " +
                                     "instance at least " +
                                     "once before installing mods.");
         return;
     }
     Modder modder = new Modder(SelectedInst);
     instIconView.Sensitive = false;
     modder.Completed += (sender2, e2) => instIconView.Sensitive = true;
     StartTask(modder);
 }