fix bugs
This commit is contained in:
@@ -54,7 +54,7 @@ import org.jackhuang.hellominecraft.utils.system.OS;
|
|||||||
public final class Main implements NonConsumer {
|
public final class Main implements NonConsumer {
|
||||||
|
|
||||||
public static String launcherName = "Hello Minecraft! Launcher";
|
public static String launcherName = "Hello Minecraft! Launcher";
|
||||||
public static byte firstVer = 2, secondVer = 3, thirdVer = 4;
|
public static byte firstVer = 2, secondVer = 3, thirdVer = 4, forthVer = 10;
|
||||||
public static int minimumLauncherVersion = 16;
|
public static int minimumLauncherVersion = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import org.jackhuang.hellominecraft.launcher.utils.download.DownloadType;
|
|||||||
import org.jackhuang.hellominecraft.launcher.settings.Profile;
|
import org.jackhuang.hellominecraft.launcher.settings.Profile;
|
||||||
import org.jackhuang.hellominecraft.tasks.ParallelTask;
|
import org.jackhuang.hellominecraft.tasks.ParallelTask;
|
||||||
import org.jackhuang.hellominecraft.tasks.TaskWindow;
|
import org.jackhuang.hellominecraft.tasks.TaskWindow;
|
||||||
import org.jackhuang.hellominecraft.tasks.download.FileDownloadTask;
|
|
||||||
import org.jackhuang.hellominecraft.utils.system.Compressor;
|
import org.jackhuang.hellominecraft.utils.system.Compressor;
|
||||||
import org.jackhuang.hellominecraft.utils.system.MessageBox;
|
import org.jackhuang.hellominecraft.utils.system.MessageBox;
|
||||||
|
|
||||||
@@ -46,10 +45,9 @@ public class DefaultGameLauncher extends GameLauncher {
|
|||||||
downloadLibrariesEvent.register((sender, t) -> {
|
downloadLibrariesEvent.register((sender, t) -> {
|
||||||
final TaskWindow dw = TaskWindow.getInstance();
|
final TaskWindow dw = TaskWindow.getInstance();
|
||||||
ParallelTask parallelTask = new ParallelTask();
|
ParallelTask parallelTask = new ParallelTask();
|
||||||
for (DownloadLibraryJob s : t) {
|
for (DownloadLibraryJob s : t)
|
||||||
//parallelTask.addDependsTask(new FileDownloadTask(s.url, s.path).setTag(s.name));
|
//parallelTask.addDependsTask(new FileDownloadTask(s.url, s.path).setTag(s.name));
|
||||||
parallelTask.addDependsTask(new LibraryDownloadTask(s));
|
parallelTask.addDependsTask(new LibraryDownloadTask(s));
|
||||||
}
|
|
||||||
dw.addTask(parallelTask);
|
dw.addTask(parallelTask);
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
if (t.size() > 0) flag = dw.start();
|
if (t.size() > 0) flag = dw.start();
|
||||||
@@ -58,6 +56,7 @@ public class DefaultGameLauncher extends GameLauncher {
|
|||||||
return flag;
|
return flag;
|
||||||
});
|
});
|
||||||
decompressNativesEvent.register((sender, value) -> {
|
decompressNativesEvent.register((sender, value) -> {
|
||||||
|
if (value == null) return false;
|
||||||
for (int i = 0; i < value.decompressFiles.length; i++)
|
for (int i = 0; i < value.decompressFiles.length; i++)
|
||||||
try {
|
try {
|
||||||
Compressor.unzip(value.decompressFiles[i], value.decompressTo, value.extractRules[i]);
|
Compressor.unzip(value.decompressFiles[i], value.decompressTo, value.extractRules[i]);
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ public final class Settings {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
settings = initSettings();
|
settings = initSettings();
|
||||||
if (!getVersions().containsKey(DEFAULT_PROFILE))
|
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
||||||
getVersions().put(DEFAULT_PROFILE, new Profile());
|
getProfiles().put(DEFAULT_PROFILE, new Profile());
|
||||||
|
|
||||||
for (Profile e : getVersions().values())
|
for (Profile e : getProfiles().values())
|
||||||
e.checkFormat();
|
e.checkFormat();
|
||||||
|
|
||||||
UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.firstVer, Main.secondVer, Main.thirdVer),
|
UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.firstVer, Main.secondVer, Main.thirdVer),
|
||||||
@@ -116,42 +116,42 @@ public final class Settings {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Profile getVersion(String name) {
|
public static Profile getProfile(String name) {
|
||||||
return getVersions().get(name);
|
return getProfiles().get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String, Profile> getVersions() {
|
public static Map<String, Profile> getProfiles() {
|
||||||
return settings.getConfigurations();
|
return settings.getConfigurations();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setVersion(Profile ver) {
|
public static void setProfile(Profile ver) {
|
||||||
getVersions().put(ver.getName(), ver);
|
getProfiles().put(ver.getName(), ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Collection<Profile> getProfiles() {
|
public static Collection<Profile> getProfilesFiltered() {
|
||||||
return CollectionUtils.sortOut(getVersions().values(), (t) -> t != null && t.getName() != null);
|
return CollectionUtils.sortOut(getProfiles().values(), (t) -> t != null && t.getName() != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Profile getOneProfile() {
|
public static Profile getOneProfile() {
|
||||||
return settings.getConfigurations().firstEntry().getValue();
|
return settings.getConfigurations().firstEntry().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean trySetVersion(Profile ver) {
|
public static boolean trySetProfile(Profile ver) {
|
||||||
if (ver == null || ver.getName() == null || getVersions().containsKey(ver.getName()))
|
if (ver == null || ver.getName() == null || getProfiles().containsKey(ver.getName()))
|
||||||
return false;
|
return false;
|
||||||
getVersions().put(ver.getName(), ver);
|
getProfiles().put(ver.getName(), ver);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean delVersion(Profile ver) {
|
public static boolean delProfile(Profile ver) {
|
||||||
return delVersion(ver.getName());
|
return delProfile(ver.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean delVersion(String ver) {
|
public static boolean delProfile(String ver) {
|
||||||
if (DEFAULT_PROFILE.equals(ver)) {
|
if (DEFAULT_PROFILE.equals(ver)) {
|
||||||
MessageBox.Show(C.i18n("settings.cannot_remove_default_config"));
|
MessageBox.Show(C.i18n("settings.cannot_remove_default_config"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return getVersions().remove(ver) != null;
|
return getProfiles().remove(ver) != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.utils;
|
package org.jackhuang.hellominecraft.launcher.utils;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.Main;
|
import org.jackhuang.hellominecraft.launcher.Main;
|
||||||
import org.jackhuang.hellominecraft.launcher.launch.MinecraftCrashAdvicer;
|
|
||||||
import org.jackhuang.hellominecraft.utils.NetUtils;
|
import org.jackhuang.hellominecraft.utils.NetUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.UpdateChecker;
|
import org.jackhuang.hellominecraft.utils.UpdateChecker;
|
||||||
import org.jackhuang.hellominecraft.utils.system.MessageBox;
|
import org.jackhuang.hellominecraft.utils.system.MessageBox;
|
||||||
@@ -42,17 +42,38 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler {
|
|||||||
this.enableLogger = enableLogger;
|
this.enableLogger = enableLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkThrowable(Throwable e) {
|
||||||
|
String s = StrUtils.getStackTrace(e);
|
||||||
|
if(s.contains("sun.awt.shell.Win32ShellFolder2") || s.contains("UnsatisfiedLinkError")) {
|
||||||
|
System.out.println(C.i18n("crash.user_fault"));
|
||||||
|
try {
|
||||||
|
MessageBox.Show(C.i18n("crash.user_fault"));
|
||||||
|
} catch(Throwable t) {
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else if(s.contains("java.awt.HeadlessException")) {
|
||||||
|
System.out.println(C.i18n("crash.headless"));
|
||||||
|
try {
|
||||||
|
MessageBox.Show(C.i18n("crash.headless"));
|
||||||
|
} catch(Throwable t) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uncaughtException(Thread t, Throwable e) {
|
public void uncaughtException(Thread t, Throwable e) {
|
||||||
|
if (!checkThrowable(e)) return;
|
||||||
|
String s = StrUtils.getStackTrace(e);
|
||||||
|
if (!s.contains("org.jackhuang.hellominecraft")) return;
|
||||||
try {
|
try {
|
||||||
String text = "\n---- Hello Minecraft! Crash Report ----\n";
|
String text = "\n---- Hello Minecraft! Crash Report ----\n";
|
||||||
text += " Version: " + Main.makeVersion() + "\n";
|
text += " Version: " + Main.makeVersion() + "." + Main.forthVer + "\n";
|
||||||
text += " Time: " + DateFormat.getDateInstance().format(new Date()) + "\n";
|
text += " Time: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "\n";
|
||||||
text += " Thread: " + t.toString() + "\n";
|
text += " Thread: " + t.toString() + "\n";
|
||||||
text += "\n Advice: \n ";
|
|
||||||
text += MinecraftCrashAdvicer.getAdvice(StrUtils.getStackTrace(e), true);
|
|
||||||
text += "\n Content: \n ";
|
text += "\n Content: \n ";
|
||||||
text += StrUtils.getStackTrace(e) + "\n\n";
|
text += s + "\n\n";
|
||||||
text += "-- System Details --\n";
|
text += "-- System Details --\n";
|
||||||
text += " Operating System: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n";
|
text += " Operating System: " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") version " + System.getProperty("os.version") + "\n";
|
||||||
text += " Java Version: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n";
|
text += " Java Version: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + "\n";
|
||||||
@@ -61,7 +82,7 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler {
|
|||||||
else System.out.println(text);
|
else System.out.println(text);
|
||||||
SwingUtilities.invokeLater(() -> LogWindow.instance.showAsCrashWindow(UpdateChecker.OUT_DATED));
|
SwingUtilities.invokeLater(() -> LogWindow.instance.showAsCrashWindow(UpdateChecker.OUT_DATED));
|
||||||
if (!UpdateChecker.OUT_DATED)
|
if (!UpdateChecker.OUT_DATED)
|
||||||
reportToServer(text, e);
|
reportToServer(text, s);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
try {
|
try {
|
||||||
MessageBox.Show(e.getMessage() + "\n" + ex.getMessage(), "ERROR", MessageBox.ERROR_MESSAGE);
|
MessageBox.Show(e.getMessage() + "\n" + ex.getMessage(), "ERROR", MessageBox.ERROR_MESSAGE);
|
||||||
@@ -74,10 +95,9 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler {
|
|||||||
|
|
||||||
private static final HashSet<String> throwableSet = new HashSet<>();
|
private static final HashSet<String> throwableSet = new HashSet<>();
|
||||||
|
|
||||||
void reportToServer(String text, Throwable t) {
|
void reportToServer(String text, String stacktrace) {
|
||||||
String s = StrUtils.getStackTrace(t);
|
if (throwableSet.contains(stacktrace)) return;
|
||||||
if (throwableSet.contains(s)) return;
|
throwableSet.add(stacktrace);
|
||||||
throwableSet.add(s);
|
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("CrashReport", text);
|
map.put("CrashReport", text);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.jackhuang.hellominecraft.launcher.utils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import javax.swing.filechooser.FileFilter;
|
import javax.swing.filechooser.FileFilter;
|
||||||
|
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -33,7 +34,7 @@ public class FileNameFilter extends FileFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(File f) {
|
public boolean accept(File f) {
|
||||||
return f.isDirectory() || f.getName().equals(acceptedName);
|
return f.isDirectory() || f.getName().equals(acceptedName) && !FileUtils.getExtension(f.getName()).equals("lnk");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import com.google.gson.JsonSyntaxException;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -283,6 +282,7 @@ public final class MinecraftVersionManager extends IMinecraftProvider {
|
|||||||
@Override
|
@Override
|
||||||
public GameLauncher.DecompressLibraryJob getDecompressLibraries() {
|
public GameLauncher.DecompressLibraryJob getDecompressLibraries() {
|
||||||
MinecraftVersion v = profile.getSelectedMinecraftVersion().resolve(this, Settings.getInstance().getDownloadSource());
|
MinecraftVersion v = profile.getSelectedMinecraftVersion().resolve(this, Settings.getInstance().getDownloadSource());
|
||||||
|
if (v.libraries == null) return null;
|
||||||
ArrayList<File> unzippings = new ArrayList<>();
|
ArrayList<File> unzippings = new ArrayList<>();
|
||||||
ArrayList<String[]> extractRules = new ArrayList<>();
|
ArrayList<String[]> extractRules = new ArrayList<>();
|
||||||
for (IMinecraftLibrary l : v.libraries) {
|
for (IMinecraftLibrary l : v.libraries) {
|
||||||
|
|||||||
@@ -1102,7 +1102,7 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
|
|||||||
private void btnRemoveProfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveProfileActionPerformed
|
private void btnRemoveProfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveProfileActionPerformed
|
||||||
if (profile == null) return;
|
if (profile == null) return;
|
||||||
if (MessageBox.Show(C.i18n("ui.message.sure_remove", profile.getName()), MessageBox.YES_NO_OPTION) == MessageBox.NO_OPTION) return;
|
if (MessageBox.Show(C.i18n("ui.message.sure_remove", profile.getName()), MessageBox.YES_NO_OPTION) == MessageBox.NO_OPTION) return;
|
||||||
if (Settings.delVersion(profile)) {
|
if (Settings.delProfile(profile)) {
|
||||||
cboProfiles.removeItem(profile.getName());
|
cboProfiles.removeItem(profile.getName());
|
||||||
profile = Settings.getOneProfile();
|
profile = Settings.getOneProfile();
|
||||||
if (profile != null) {
|
if (profile != null) {
|
||||||
@@ -1218,7 +1218,7 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
|
|||||||
MessageBox.Show(C.i18n("setupwindow.no_empty_name"));
|
MessageBox.Show(C.i18n("setupwindow.no_empty_name"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Settings.trySetVersion(new Profile(name).setGameDir(newGameDir.getAbsolutePath()));
|
Settings.trySetProfile(new Profile(name).setGameDir(newGameDir.getAbsolutePath()));
|
||||||
MessageBox.Show(C.i18n("setupwindow.find_in_configurations"));
|
MessageBox.Show(C.i18n("setupwindow.find_in_configurations"));
|
||||||
loadProfiles();
|
loadProfiles();
|
||||||
}
|
}
|
||||||
@@ -1438,7 +1438,7 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
|
|||||||
cboProfiles.removeAllItems();
|
cboProfiles.removeAllItems();
|
||||||
Profile firstProfile = null, selectedProfile = null;
|
Profile firstProfile = null, selectedProfile = null;
|
||||||
int index = 0, i = 0;
|
int index = 0, i = 0;
|
||||||
for (Profile s : Settings.getProfiles()) {
|
for (Profile s : Settings.getProfilesFiltered()) {
|
||||||
if (firstProfile == null) firstProfile = s;
|
if (firstProfile == null) firstProfile = s;
|
||||||
cboProfiles.addItem(s.getName());
|
cboProfiles.addItem(s.getName());
|
||||||
if (Settings.getInstance().getLast() != null && Settings.getInstance().getLast().equals(s.getName())) {
|
if (Settings.getInstance().getLast() != null && Settings.getInstance().getLast().equals(s.getName())) {
|
||||||
@@ -1461,7 +1461,7 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
|
|||||||
|
|
||||||
final Profile getProfile() {
|
final Profile getProfile() {
|
||||||
if (cboProfiles.getSelectedIndex() >= 0)
|
if (cboProfiles.getSelectedIndex() >= 0)
|
||||||
return Settings.getVersion(cboProfiles.getSelectedItem().toString());
|
return Settings.getProfile(cboProfiles.getSelectedItem().toString());
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ public class MainPagePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loadFromSettings() {
|
void loadFromSettings() {
|
||||||
for (Profile s : Settings.getProfiles()) cboProfiles.addItem(s.getName());
|
for (Profile s : Settings.getProfilesFiltered()) cboProfiles.addItem(s.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean showedNoVersion = false;
|
boolean showedNoVersion = false;
|
||||||
@@ -460,23 +460,25 @@ public class MainPagePanel extends javax.swing.JPanel {
|
|||||||
isLoading = true;
|
isLoading = true;
|
||||||
cboVersions.removeAllItems();
|
cboVersions.removeAllItems();
|
||||||
int index = 0, i = 0;
|
int index = 0, i = 0;
|
||||||
getCurrentProfile().getMinecraftProvider().refreshVersions();
|
if (getCurrentProfile() != null) {
|
||||||
MinecraftVersion selVersion = getCurrentProfile().getSelectedMinecraftVersion();
|
getCurrentProfile().getMinecraftProvider().refreshVersions();
|
||||||
String selectedMC = selVersion == null ? null : selVersion.id;
|
MinecraftVersion selVersion = getCurrentProfile().getSelectedMinecraftVersion();
|
||||||
if (getCurrentProfile().getMinecraftProvider().getVersions().isEmpty()) {
|
String selectedMC = selVersion == null ? null : selVersion.id;
|
||||||
if (!showedNoVersion)
|
if (getCurrentProfile().getMinecraftProvider().getVersions().isEmpty()) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
if (!showedNoVersion)
|
||||||
MessageBox.Show(C.i18n("mainwindow.no_version"));
|
SwingUtilities.invokeLater(() -> {
|
||||||
showedNoVersion = true;
|
MessageBox.Show(C.i18n("mainwindow.no_version"));
|
||||||
});
|
showedNoVersion = true;
|
||||||
} else {
|
});
|
||||||
for (MinecraftVersion mcVersion : getCurrentProfile().getMinecraftProvider().getVersions()) {
|
} else {
|
||||||
if (mcVersion.hidden) continue;
|
for (MinecraftVersion mcVersion : getCurrentProfile().getMinecraftProvider().getVersions()) {
|
||||||
cboVersions.addItem(mcVersion.id);
|
if (mcVersion.hidden) continue;
|
||||||
if (mcVersion.id.equals(selectedMC)) index = i;
|
cboVersions.addItem(mcVersion.id);
|
||||||
i++;
|
if (mcVersion.id.equals(selectedMC)) index = i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (index < cboVersions.getItemCount()) cboVersions.setSelectedIndex(index);
|
||||||
}
|
}
|
||||||
if (index < cboVersions.getItemCount()) cboVersions.setSelectedIndex(index);
|
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
}
|
}
|
||||||
@@ -533,7 +535,7 @@ public class MainPagePanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Profile getCurrentProfile() {
|
public Profile getCurrentProfile() {
|
||||||
return Settings.getVersion((String) cboProfiles.getSelectedItem());
|
return Settings.getProfile((String) cboProfiles.getSelectedItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSelected() {
|
public void onSelected() {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public final class NewProfileWindow extends javax.swing.JDialog {
|
|||||||
|
|
||||||
setLocationRelativeTo(null);
|
setLocationRelativeTo(null);
|
||||||
|
|
||||||
for (Profile s : Settings.getProfiles())
|
for (Profile s : Settings.getProfilesFiltered())
|
||||||
cboProfiles.addItem(s.getName());
|
cboProfiles.addItem(s.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,9 +126,9 @@ public final class NewProfileWindow extends javax.swing.JDialog {
|
|||||||
private void txtNewProfileNameKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNewProfileNameKeyTyped
|
private void txtNewProfileNameKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNewProfileNameKeyTyped
|
||||||
switch (evt.getKeyCode()) {
|
switch (evt.getKeyCode()) {
|
||||||
case 13:
|
case 13:
|
||||||
Profile newProfile = new Profile(Settings.getVersion(cboProfiles.getSelectedItem().toString()));
|
Profile newProfile = new Profile(Settings.getProfile(cboProfiles.getSelectedItem().toString()));
|
||||||
newProfile.setName(txtNewProfileName.getText());
|
newProfile.setName(txtNewProfileName.getText());
|
||||||
Settings.trySetVersion(newProfile);
|
Settings.trySetProfile(newProfile);
|
||||||
case 27:
|
case 27:
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}
|
}
|
||||||
@@ -136,9 +136,9 @@ public final class NewProfileWindow extends javax.swing.JDialog {
|
|||||||
|
|
||||||
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
|
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
|
||||||
if (!StrUtils.isBlank(txtNewProfileName.getText())) {
|
if (!StrUtils.isBlank(txtNewProfileName.getText())) {
|
||||||
Profile newProfile = new Profile(Settings.getVersion(cboProfiles.getSelectedItem().toString()));
|
Profile newProfile = new Profile(Settings.getProfile(cboProfiles.getSelectedItem().toString()));
|
||||||
newProfile.setName(txtNewProfileName.getText());
|
newProfile.setName(txtNewProfileName.getText());
|
||||||
Settings.trySetVersion(newProfile);
|
Settings.trySetProfile(newProfile);
|
||||||
}
|
}
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}//GEN-LAST:event_btnOKActionPerformed
|
}//GEN-LAST:event_btnOKActionPerformed
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package org.jackhuang.hellominecraft.utils;
|
|||||||
import java.awt.FontMetrics;
|
import java.awt.FontMetrics;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import javax.swing.DefaultListModel;
|
import javax.swing.DefaultListModel;
|
||||||
|
import javax.swing.JFileChooser;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JList;
|
import javax.swing.JList;
|
||||||
import javax.swing.JScrollBar;
|
import javax.swing.JScrollBar;
|
||||||
@@ -169,5 +170,4 @@ public class SwingUtils {
|
|||||||
}
|
}
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ crash.advice.no_lwjgl=\u53ef\u80fd\u662f\u6e38\u620f\u4f9d\u8d56\u5e93\u4e0d\u5b
|
|||||||
|
|
||||||
crash.advice.no=\u65e0\u5efa\u8bae\u3002
|
crash.advice.no=\u65e0\u5efa\u8bae\u3002
|
||||||
|
|
||||||
|
crash.user_fault=\u60a8\u7684\u7cfb\u7edf\u6216Java\u73af\u5883\u53ef\u80fd\u5b89\u88c5\u4e0d\u5f53\u5bfc\u81f4\u672c\u8f6f\u4ef6\u5d29\u6e83\uff0c\u8bf7\u68c0\u67e5\u60a8\u7684Java\u73af\u5883\u6216\u60a8\u7684\u7535\u8111\uff01\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5Java\u3002
|
||||||
|
crash.headless=\u5982\u679c\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u662fLinux\uff0c\u8bf7\u6ce8\u610f\u4e0d\u8981\u4f7f\u7528OpenJDK\uff0c\u52a1\u5fc5\u4f7f\u7528Oracle JDK\uff0c\u6216\u5c1d\u8bd5\u6dfb\u52a0-Djava.awt.headless=false\u53c2\u6570\uff0c\u6216\u68c0\u67e5\u60a8\u7684Xserver\u662f\u5426\u6b63\u5e38
|
||||||
|
|
||||||
crash.error=\u60a8\u7684Minecraft\u5d29\u6e83\u4e86\u3002
|
crash.error=\u60a8\u7684Minecraft\u5d29\u6e83\u4e86\u3002
|
||||||
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u7c7b\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5199\u9519\u8bef\u3002\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u6574\u5408\u5305\u89e3\u51b3\u95ee\u9898\u3002
|
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u7c7b\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5199\u9519\u8bef\u3002\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u6574\u5408\u5305\u89e3\u51b3\u95ee\u9898\u3002
|
||||||
crash.class_path_wrong=\u89e3\u6790Class Path\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u6b64\u9519\u8bef\u672c\u4e0d\u5e94\u8be5\u53d1\u751f\u3002\u53ef\u80fd\u662f\u542f\u52a8\u811a\u672c\u9519\u8bef\uff0c\u8bf7\u4ed4\u7ec6\u68c0\u67e5\u542f\u52a8\u811a\u672c\u3002
|
crash.class_path_wrong=\u89e3\u6790Class Path\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u6b64\u9519\u8bef\u672c\u4e0d\u5e94\u8be5\u53d1\u751f\u3002\u53ef\u80fd\u662f\u542f\u52a8\u811a\u672c\u9519\u8bef\uff0c\u8bf7\u4ed4\u7ec6\u68c0\u67e5\u542f\u52a8\u811a\u672c\u3002
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ crash.advice.no_lwjgl=Maybe drivers caused problems.
|
|||||||
|
|
||||||
crash.advice.no=No advice.
|
crash.advice.no=No advice.
|
||||||
|
|
||||||
|
crash.user_fault=Your OS or Java environment may not be properly installed resulting in crashing of this software, please check your Java Environment or your computer!
|
||||||
|
crash.headless=If your OS is Linux, please use Oracle JDK instead of OpenJDK, or add "-Djava.awt.headless=false" JVM argument, or check if your Xserver works normally.
|
||||||
|
|
||||||
crash.error=Minecraft has crashed.
|
crash.error=Minecraft has crashed.
|
||||||
crash.main_class_not_found=Main Class is not found, may be your mc has been broken.
|
crash.main_class_not_found=Main Class is not found, may be your mc has been broken.
|
||||||
crash.class_path_wrong=Maybe the launch script is malformed.
|
crash.class_path_wrong=Maybe the launch script is malformed.
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ crash.advice.no_lwjgl=\u53ef\u80fd\u662f\u6e38\u620f\u4f9d\u8d56\u5e93\u4e0d\u5b
|
|||||||
|
|
||||||
crash.advice.no=\u65e0\u5efa\u8bae\u3002
|
crash.advice.no=\u65e0\u5efa\u8bae\u3002
|
||||||
|
|
||||||
|
crash.user_fault=\u60a8\u7684\u7cfb\u7edf\u6216Java\u73af\u5883\u53ef\u80fd\u5b89\u88c5\u4e0d\u5f53\u5bfc\u81f4\u672c\u8f6f\u4ef6\u5d29\u6e83\uff0c\u8bf7\u68c0\u67e5\u60a8\u7684Java\u73af\u5883\u6216\u60a8\u7684\u7535\u8111\uff01\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5Java\u3002
|
||||||
|
crash.headless=\u5982\u679c\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u662fLinux\uff0c\u8bf7\u6ce8\u610f\u4e0d\u8981\u4f7f\u7528OpenJDK\uff0c\u52a1\u5fc5\u4f7f\u7528Oracle JDK\uff0c\u6216\u5c1d\u8bd5\u6dfb\u52a0-Djava.awt.headless=false\u53c2\u6570\uff0c\u6216\u68c0\u67e5\u60a8\u7684Xserver\u662f\u5426\u6b63\u5e38
|
||||||
|
|
||||||
crash.error=\u60a8\u7684Minecraft\u5d29\u6e83\u4e86\u3002
|
crash.error=\u60a8\u7684Minecraft\u5d29\u6e83\u4e86\u3002
|
||||||
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u7c7b\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5199\u9519\u8bef\u3002\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u6574\u5408\u5305\u89e3\u51b3\u95ee\u9898\u3002
|
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u7c7b\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5199\u9519\u8bef\u3002\u65e0\u6cd5\u542f\u52a8\u6e38\u620f\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u8f7d\u6574\u5408\u5305\u89e3\u51b3\u95ee\u9898\u3002
|
||||||
crash.class_path_wrong=\u89e3\u6790Class Path\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u6b64\u9519\u8bef\u672c\u4e0d\u5e94\u8be5\u53d1\u751f\u3002\u53ef\u80fd\u662f\u542f\u52a8\u811a\u672c\u9519\u8bef\uff0c\u8bf7\u4ed4\u7ec6\u68c0\u67e5\u542f\u52a8\u811a\u672c\u3002
|
crash.class_path_wrong=\u89e3\u6790Class Path\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u6b64\u9519\u8bef\u672c\u4e0d\u5e94\u8be5\u53d1\u751f\u3002\u53ef\u80fd\u662f\u542f\u52a8\u811a\u672c\u9519\u8bef\uff0c\u8bf7\u4ed4\u7ec6\u68c0\u67e5\u542f\u52a8\u811a\u672c\u3002
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ crash.advice.no_lwjgl=\u53ef\u80fd\u662f\u904a\u6232\u4f9d\u8cf4\u5eab\u4e0d\u5b
|
|||||||
|
|
||||||
crash.advice.no=\u7121\u5efa\u8b70\u3002
|
crash.advice.no=\u7121\u5efa\u8b70\u3002
|
||||||
|
|
||||||
|
crash.user_fault=\u60a8\u7684\u7cfb\u7d71\u6216Java\u74b0\u5883\u53ef\u80fd\u5b89\u88dd\u4e0d\u7576\u5c0e\u81f4\u672c\u8edf\u4ef6\u5d29\u6f70\uff0c\u8acb\u6aa2\u67e5\u60a8\u7684Java\u74b0\u5883\u6216\u60a8\u7684\u96fb\u8166\uff01\u53ef\u4ee5\u5617\u8a66\u91cd\u65b0\u5b89\u88ddJava\u3002
|
||||||
|
crash.headless=\u5982\u679c\u60a8\u7684\u64cd\u4f5c\u7cfb\u7d71\u662fLinux\uff0c\u8acb\u6ce8\u610f\u4e0d\u8981\u4f7f\u7528OpenJDK\uff0c\u52d9\u5fc5\u4f7f\u7528Oracle JDK\uff0c\u6216\u5617\u8a66\u6dfb\u52a0-Djava.awt.headless=false\u53c3\u6578\uff0c\u6216\u6aa2\u67e5\u60a8\u7684Xserver\u662f\u5426\u6b63\u5e38
|
||||||
|
|
||||||
crash.error=\u60a8\u7684Minecraft\u5d29\u6f70\u4e86\u3002
|
crash.error=\u60a8\u7684Minecraft\u5d29\u6f70\u4e86\u3002
|
||||||
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
|
crash.main_class_not_found=\u627e\u4e0d\u5230\u4e3b\u985e\uff0c\u53ef\u80fd\u662f\u60a8\u7684JSON\u6587\u4ef6\u586b\u5beb\u932f\u8aa4\u3002\u7121\u6cd5\u555f\u52d5\u904a\u6232\u3002\u53ef\u4ee5\u901a\u904e\u4e0b\u8f09\u6574\u5408\u5305\u89e3\u6c7a\u554f\u984c\u3002
|
||||||
crash.class_path_wrong=\u89e3\u6790Class Path\u6642\u51fa\u73fe\u932f\u8aa4\uff0c\u6b64\u932f\u8aa4\u672c\u4e0d\u61c9\u8a72\u767c\u751f\u3002\u53ef\u80fd\u662f\u555f\u52d5\u8173\u672c\u932f\u8aa4\uff0c\u8acb\u4ed4\u7d30\u6aa2\u67e5\u555f\u52d5\u8173\u672c\u3002
|
crash.class_path_wrong=\u89e3\u6790Class Path\u6642\u51fa\u73fe\u932f\u8aa4\uff0c\u6b64\u932f\u8aa4\u672c\u4e0d\u61c9\u8a72\u767c\u751f\u3002\u53ef\u80fd\u662f\u555f\u52d5\u8173\u672c\u932f\u8aa4\uff0c\u8acb\u4ed4\u7d30\u6aa2\u67e5\u555f\u52d5\u8173\u672c\u3002
|
||||||
|
|||||||
Reference in New Issue
Block a user