getting core 4
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.settings;
|
package org.jackhuang.hellominecraft.launcher.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -28,7 +28,6 @@ import java.util.zip.ZipFile;
|
|||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.utils.StrUtils;
|
import org.jackhuang.hellominecraft.utils.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.views.SwingUtils;
|
|
||||||
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,11 +54,6 @@ public class ModInfo implements Comparable<ModInfo> {
|
|||||||
location = newf;
|
location = newf;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showURL() {
|
|
||||||
if (url != null)
|
|
||||||
SwingUtils.openLink(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(ModInfo o) {
|
public int compareTo(ModInfo o) {
|
||||||
return getFileName().toLowerCase().compareTo(o.getFileName().toLowerCase());
|
return getFileName().toLowerCase().compareTo(o.getFileName().toLowerCase());
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ import java.io.File;
|
|||||||
import org.jackhuang.hellominecraft.launcher.api.PluginManager;
|
import org.jackhuang.hellominecraft.launcher.api.PluginManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.MCUtils;
|
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.GameDirType;
|
import org.jackhuang.hellominecraft.launcher.core.version.GameDirType;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.LauncherVisibility;
|
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
|
||||||
import org.jackhuang.hellominecraft.utils.StrUtils;
|
import org.jackhuang.hellominecraft.utils.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.Utils;
|
import org.jackhuang.hellominecraft.utils.Utils;
|
||||||
import org.jackhuang.hellominecraft.utils.EventHandler;
|
import org.jackhuang.hellominecraft.utils.EventHandler;
|
||||||
@@ -112,7 +109,7 @@ public final class Profile {
|
|||||||
|
|
||||||
public void setSelectedMinecraftVersion(String selectedMinecraftVersion) {
|
public void setSelectedMinecraftVersion(String selectedMinecraftVersion) {
|
||||||
this.selectedMinecraftVersion = selectedMinecraftVersion;
|
this.selectedMinecraftVersion = selectedMinecraftVersion;
|
||||||
Settings.save();
|
propertyChanged.execute("selectedMinecraftVersion");
|
||||||
selectedVersionChangedEvent.execute(selectedMinecraftVersion);
|
selectedVersionChangedEvent.execute(selectedMinecraftVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,13 +160,13 @@ public final class Profile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Java getJava() {
|
public Java getJava() {
|
||||||
return Settings.JAVA.get(getJavaIndexInAllJavas());
|
return Java.JAVA.get(getJavaIndexInAllJavas());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getJavaIndexInAllJavas() {
|
public int getJavaIndexInAllJavas() {
|
||||||
if (StrUtils.isBlank(java) && StrUtils.isNotBlank(javaDir))
|
if (StrUtils.isBlank(java) && StrUtils.isNotBlank(javaDir))
|
||||||
java = "Custom";
|
java = "Custom";
|
||||||
int idx = Settings.JAVA.indexOf(new Java(java, null));
|
int idx = Java.JAVA.indexOf(new Java(java, null));
|
||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
java = "Default";
|
java = "Default";
|
||||||
idx = 0;
|
idx = 0;
|
||||||
@@ -179,9 +176,9 @@ public final class Profile {
|
|||||||
|
|
||||||
public void setJava(Java java) {
|
public void setJava(Java java) {
|
||||||
if (java == null)
|
if (java == null)
|
||||||
this.java = Settings.JAVA.get(0).getName();
|
this.java = Java.JAVA.get(0).getName();
|
||||||
else {
|
else {
|
||||||
int idx = Settings.JAVA.indexOf(java);
|
int idx = Java.JAVA.indexOf(java);
|
||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
return;
|
return;
|
||||||
this.java = java.getName();
|
this.java = java.getName();
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.util.Map;
|
|||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftAssetService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftAssetService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftProvider;
|
|
||||||
import org.jackhuang.hellominecraft.tasks.Task;
|
import org.jackhuang.hellominecraft.tasks.Task;
|
||||||
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
||||||
|
|||||||
@@ -44,4 +44,17 @@ public enum DownloadType {
|
|||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DownloadType suggestedDownloadType = Mojang;
|
||||||
|
|
||||||
|
public static DownloadType getSuggestedDownloadType() {
|
||||||
|
return suggestedDownloadType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setSuggestedDownloadType(DownloadType suggestedDownloadType) {
|
||||||
|
if (suggestedDownloadType == null)
|
||||||
|
throw new IllegalArgumentException("download type should not be null.");
|
||||||
|
DownloadType.suggestedDownloadType = suggestedDownloadType;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package org.jackhuang.hellominecraft.launcher.core.installers;
|
|||||||
|
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftInstallerService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftInstallerService;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftBasicService;
|
|
||||||
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionList.InstallerVersion;
|
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionList.InstallerVersion;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.installers.forge.ForgeInstaller;
|
import org.jackhuang.hellominecraft.launcher.core.installers.forge.ForgeInstaller;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
import org.jackhuang.hellominecraft.launcher.core.download.DownloadType;
|
||||||
import org.jackhuang.hellominecraft.utils.StrUtils;
|
import org.jackhuang.hellominecraft.utils.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionList;
|
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionList;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionNewerComparator;
|
import org.jackhuang.hellominecraft.launcher.core.installers.InstallerVersionNewerComparator;
|
||||||
@@ -51,7 +51,7 @@ public class MinecraftForgeVersionList extends InstallerVersionList {
|
|||||||
public void refreshList(String[] needed) throws Exception {
|
public void refreshList(String[] needed) throws Exception {
|
||||||
if (root != null)
|
if (root != null)
|
||||||
return;
|
return;
|
||||||
String s = NetUtils.get(Settings.getInstance().getDownloadSource().getProvider().getParsedLibraryDownloadURL(C.URL_FORGE_LIST));
|
String s = NetUtils.get(DownloadType.getSuggestedDownloadType().getProvider().getParsedLibraryDownloadURL(C.URL_FORGE_LIST));
|
||||||
|
|
||||||
root = C.gson.fromJson(s, MinecraftForgeVersionRoot.class);
|
root = C.gson.fromJson(s, MinecraftForgeVersionRoot.class);
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ public class MinecraftForgeVersionList extends InstallerVersionList {
|
|||||||
if (!StrUtils.isBlank(v.branch))
|
if (!StrUtils.isBlank(v.branch))
|
||||||
ver = ver + "-" + v.branch;
|
ver = ver + "-" + v.branch;
|
||||||
String filename = root.artifact + "-" + ver + "-" + f[1] + "." + f[0];
|
String filename = root.artifact + "-" + ver + "-" + f[1] + "." + f[0];
|
||||||
String url = Settings.getInstance().getDownloadSource().getProvider().getParsedLibraryDownloadURL(root.webpath + ver + "/" + filename);
|
String url = DownloadType.getSuggestedDownloadType().getProvider().getParsedLibraryDownloadURL(root.webpath + ver + "/" + filename);
|
||||||
switch (f[1]) {
|
switch (f[1]) {
|
||||||
case "installer":
|
case "installer":
|
||||||
iv.installer = url;
|
iv.installer = url;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public abstract class IMinecraftService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public DownloadType getDownloadType() {
|
public DownloadType getDownloadType() {
|
||||||
return Settings.getInstance().getDownloadSource();
|
return DownloadType.getSuggestedDownloadType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract IMinecraftAssetService asset();
|
public abstract IMinecraftAssetService asset();
|
||||||
|
|||||||
@@ -29,14 +29,13 @@ import java.util.Map;
|
|||||||
import org.jackhuang.hellominecraft.C;
|
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.core.download.DownloadType;
|
||||||
import org.jackhuang.hellominecraft.utils.CollectionUtils;
|
import org.jackhuang.hellominecraft.utils.CollectionUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
import org.jackhuang.hellominecraft.utils.system.FileUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
import org.jackhuang.hellominecraft.utils.system.IOUtils;
|
||||||
import org.jackhuang.hellominecraft.utils.MessageBox;
|
import org.jackhuang.hellominecraft.utils.MessageBox;
|
||||||
import org.jackhuang.hellominecraft.utils.UpdateChecker;
|
import org.jackhuang.hellominecraft.utils.UpdateChecker;
|
||||||
import org.jackhuang.hellominecraft.utils.VersionNumber;
|
import org.jackhuang.hellominecraft.utils.VersionNumber;
|
||||||
import org.jackhuang.hellominecraft.utils.system.Java;
|
|
||||||
import org.jackhuang.hellominecraft.utils.system.OS;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -51,7 +50,6 @@ public final class Settings {
|
|||||||
private static final Config SETTINGS;
|
private static final Config SETTINGS;
|
||||||
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.VERSION_FIRST, Main.VERSION_SECOND, Main.VERSION_THIRD),
|
public static final UpdateChecker UPDATE_CHECKER = new UpdateChecker(new VersionNumber(Main.VERSION_FIRST, Main.VERSION_SECOND, Main.VERSION_THIRD),
|
||||||
"hmcl");
|
"hmcl");
|
||||||
public static final List<Java> JAVA;
|
|
||||||
|
|
||||||
public static Config getInstance() {
|
public static Config getInstance() {
|
||||||
return SETTINGS;
|
return SETTINGS;
|
||||||
@@ -59,6 +57,11 @@ public final class Settings {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
SETTINGS = initSettings();
|
SETTINGS = initSettings();
|
||||||
|
SETTINGS.downloadTypeChangedEvent.register((s, t) -> {
|
||||||
|
DownloadType.setSuggestedDownloadType(t);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
DownloadType.setSuggestedDownloadType(SETTINGS.getDownloadSource());
|
||||||
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
if (!getProfiles().containsKey(DEFAULT_PROFILE))
|
||||||
getProfiles().put(DEFAULT_PROFILE, new Profile());
|
getProfiles().put(DEFAULT_PROFILE, new Profile());
|
||||||
|
|
||||||
@@ -69,15 +72,6 @@ public final class Settings {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Java> temp = new ArrayList<>();
|
|
||||||
temp.add(new Java("Default", System.getProperty("java.home")));
|
|
||||||
temp.add(new Java("Custom", null));
|
|
||||||
if (OS.os() == OS.WINDOWS)
|
|
||||||
temp.addAll(Java.queryAllJavaHomeInWindowsByReg());
|
|
||||||
if (OS.os() == OS.OSX)
|
|
||||||
temp.addAll(Java.queryAllJDKInMac());
|
|
||||||
JAVA = Collections.unmodifiableList(temp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Config initSettings() {
|
private static Config initSettings() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
* along with this program. If not, see {http://www.gnu.org/licenses/}.
|
||||||
*/
|
*/
|
||||||
package org.jackhuang.hellominecraft.launcher.core.version;
|
package org.jackhuang.hellominecraft.launcher.utils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -43,7 +43,7 @@ import javax.swing.event.TableModelEvent;
|
|||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.LauncherVisibility;
|
import org.jackhuang.hellominecraft.launcher.core.LauncherVisibility;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.Profile;
|
import org.jackhuang.hellominecraft.launcher.core.Profile;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.FileNameFilter;
|
import org.jackhuang.hellominecraft.launcher.utils.FileNameFilter;
|
||||||
@@ -91,7 +91,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
|
|||||||
initExternalModsTable();
|
initExternalModsTable();
|
||||||
initTabs();
|
initTabs();
|
||||||
|
|
||||||
for (Java j : Settings.JAVA)
|
for (Java j : Java.JAVA)
|
||||||
cboJava.addItem(j.getLocalizedName());
|
cboJava.addItem(j.getLocalizedName());
|
||||||
|
|
||||||
dropTarget = new DropTarget(lstExternalMods, DnDConstants.ACTION_COPY_OR_MOVE, this);
|
dropTarget = new DropTarget(lstExternalMods, DnDConstants.ACTION_COPY_OR_MOVE, this);
|
||||||
@@ -1045,7 +1045,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
|
|||||||
return;
|
return;
|
||||||
int idx = cboJava.getSelectedIndex();
|
int idx = cboJava.getSelectedIndex();
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
Java j = Settings.JAVA.get(idx);
|
Java j = Java.JAVA.get(idx);
|
||||||
getProfile().setJava(j);
|
getProfile().setJava(j);
|
||||||
txtJavaDir.setEnabled(idx == 1);
|
txtJavaDir.setEnabled(idx == 1);
|
||||||
txtJavaDir.setText(j.getHome() == null ? getProfile().getSettingsJavaDir() : j.getJava());
|
txtJavaDir.setText(j.getHome() == null ? getProfile().getSettingsJavaDir() : j.getJava());
|
||||||
@@ -1080,7 +1080,7 @@ public final class GameSettingsPanel extends AnimatedPanel implements DropTarget
|
|||||||
private void lblModInfoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblModInfoMouseClicked
|
private void lblModInfoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblModInfoMouseClicked
|
||||||
int idx = lstExternalMods.getSelectedRow();
|
int idx = lstExternalMods.getSelectedRow();
|
||||||
if (idx > 0 && idx < getProfile().service().mod().getMods().size())
|
if (idx > 0 && idx < getProfile().service().mod().getMods().size())
|
||||||
getProfile().service().mod().getMods().get(idx).showURL();
|
SwingUtils.openLink(getProfile().service().mod().getMods().get(idx).url);
|
||||||
}//GEN-LAST:event_lblModInfoMouseClicked
|
}//GEN-LAST:event_lblModInfoMouseClicked
|
||||||
|
|
||||||
private void btnChoosingGameDirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChoosingGameDirActionPerformed
|
private void btnChoosingGameDirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChoosingGameDirActionPerformed
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import org.jackhuang.hellominecraft.utils.MessageBox;
|
|||||||
import org.jackhuang.hellominecraft.utils.StrUtils;
|
import org.jackhuang.hellominecraft.utils.StrUtils;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
|
import org.jackhuang.hellominecraft.launcher.core.launch.GameLauncher;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.LauncherVisibility;
|
import org.jackhuang.hellominecraft.launcher.core.LauncherVisibility;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
||||||
import org.jackhuang.hellominecraft.lookandfeel.GraphicsUtils;
|
import org.jackhuang.hellominecraft.lookandfeel.GraphicsUtils;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package org.jackhuang.hellominecraft.utils.system;
|
|||||||
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.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
@@ -30,6 +31,19 @@ import org.jackhuang.hellominecraft.HMCLog;
|
|||||||
*/
|
*/
|
||||||
public class Java {
|
public class Java {
|
||||||
|
|
||||||
|
public static final List<Java> JAVA;
|
||||||
|
|
||||||
|
static {
|
||||||
|
List<Java> temp = new ArrayList<>();
|
||||||
|
temp.add(new Java("Default", System.getProperty("java.home")));
|
||||||
|
temp.add(new Java("Custom", null));
|
||||||
|
if (OS.os() == OS.WINDOWS)
|
||||||
|
temp.addAll(Java.queryAllJavaHomeInWindowsByReg());
|
||||||
|
if (OS.os() == OS.OSX)
|
||||||
|
temp.addAll(Java.queryAllJDKInMac());
|
||||||
|
JAVA = Collections.unmodifiableList(temp);
|
||||||
|
}
|
||||||
|
|
||||||
String name, home;
|
String name, home;
|
||||||
|
|
||||||
public Java(String name, String home) {
|
public Java(String name, String home) {
|
||||||
|
|||||||
@@ -100,9 +100,11 @@ public class SwingUtils {
|
|||||||
/**
|
/**
|
||||||
* Open URL by java.awt.Desktop
|
* Open URL by java.awt.Desktop
|
||||||
*
|
*
|
||||||
* @param link
|
* @param link null is allowed but will be ignored
|
||||||
*/
|
*/
|
||||||
public static void openLink(String link) {
|
public static void openLink(String link) {
|
||||||
|
if (link == null)
|
||||||
|
return;
|
||||||
try {
|
try {
|
||||||
java.awt.Desktop.getDesktop().browse(new URI(link));
|
java.awt.Desktop.getDesktop().browse(new URI(link));
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|||||||
@@ -18,17 +18,17 @@
|
|||||||
package org.jackhuang.hellominecraft.launcher.servers;
|
package org.jackhuang.hellominecraft.launcher.servers;
|
||||||
|
|
||||||
import org.jackhuang.hellominecraft.launcher.api.IPlugin;
|
import org.jackhuang.hellominecraft.launcher.api.IPlugin;
|
||||||
import org.jackhuang.hellominecraft.launcher.launch.IMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.core.Profile;
|
||||||
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftAuthenticator;
|
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.MFCraftMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.Servers;
|
import org.jackhuang.hellominecraft.launcher.servers.mfcraft.Servers;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Profile;
|
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
import org.jackhuang.hellominecraft.launcher.settings.Settings;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.AuthenticationException;
|
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.IAuthenticator;
|
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.UserProfileProvider;
|
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.YggdrasilAuthenticator;
|
import org.jackhuang.hellominecraft.launcher.core.auth.YggdrasilAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.version.ServerInfo;
|
import org.jackhuang.hellominecraft.launcher.core.version.ServerInfo;
|
||||||
import org.jackhuang.hellominecraft.launcher.views.MainFrame;
|
import org.jackhuang.hellominecraft.launcher.views.MainFrame;
|
||||||
import org.jackhuang.hellominecraft.launcher.views.ServerListView;
|
import org.jackhuang.hellominecraft.launcher.views.ServerListView;
|
||||||
import org.jackhuang.hellominecraft.utils.functions.Consumer;
|
import org.jackhuang.hellominecraft.utils.functions.Consumer;
|
||||||
|
|||||||
@@ -19,11 +19,10 @@ package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.jackhuang.hellominecraft.HMCLog;
|
import org.jackhuang.hellominecraft.HMCLog;
|
||||||
import org.jackhuang.hellominecraft.launcher.launch.IMinecraftService;
|
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService;
|
||||||
import org.jackhuang.hellominecraft.launcher.servers.ServerPlugin;
|
import org.jackhuang.hellominecraft.launcher.servers.ServerPlugin;
|
||||||
import org.jackhuang.hellominecraft.launcher.settings.Profile;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftModService;
|
||||||
import org.jackhuang.hellominecraft.launcher.version.MinecraftModService;
|
import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersionManager;
|
||||||
import org.jackhuang.hellominecraft.launcher.version.MinecraftVersionManager;
|
|
||||||
import org.jackhuang.hellominecraft.utils.ArrayUtils;
|
import org.jackhuang.hellominecraft.utils.ArrayUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,12 +20,11 @@ package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
|
|||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.jackhuang.hellominecraft.C;
|
import org.jackhuang.hellominecraft.C;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.AuthenticationException;
|
import org.jackhuang.hellominecraft.launcher.core.auth.AuthenticationException;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.IAuthenticator;
|
import org.jackhuang.hellominecraft.launcher.core.auth.IAuthenticator;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.LoginInfo;
|
import org.jackhuang.hellominecraft.launcher.core.auth.LoginInfo;
|
||||||
import static org.jackhuang.hellominecraft.launcher.utils.auth.OfflineAuthenticator.getUUIDFromUserName;
|
import static org.jackhuang.hellominecraft.launcher.core.auth.OfflineAuthenticator.getUUIDFromUserName;
|
||||||
import org.jackhuang.hellominecraft.launcher.utils.auth.UserProfileProvider;
|
import org.jackhuang.hellominecraft.launcher.core.auth.UserProfileProvider;
|
||||||
import org.jackhuang.hellominecraft.launcher.version.ServerInfo;
|
|
||||||
import org.jackhuang.hellominecraft.utils.NetUtils;
|
import org.jackhuang.hellominecraft.utils.NetUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
|
package org.jackhuang.hellominecraft.launcher.servers.mfcraft;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import org.jackhuang.hellominecraft.launcher.version.ServerInfo;
|
import org.jackhuang.hellominecraft.launcher.core.version.ServerInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user