aboutsummaryrefslogtreecommitdiff
path: root/libraries/launcher/org/multimc/applet/LegacyFrame.java
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/launcher/org/multimc/applet/LegacyFrame.java')
-rw-r--r--libraries/launcher/org/multimc/applet/LegacyFrame.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/libraries/launcher/org/multimc/applet/LegacyFrame.java b/libraries/launcher/org/multimc/applet/LegacyFrame.java
index d250ce26..c50995f6 100644
--- a/libraries/launcher/org/multimc/applet/LegacyFrame.java
+++ b/libraries/launcher/org/multimc/applet/LegacyFrame.java
@@ -23,8 +23,6 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -38,11 +36,15 @@ public final class LegacyFrame extends Frame {
private static final Logger LOGGER = Logger.getLogger("LegacyFrame");
- private Launcher appletWrap;
+ private final Launcher appletWrap;
- public LegacyFrame(String title) {
+ public LegacyFrame(String title, Applet mcApplet) {
super(title);
+ appletWrap = new Launcher(mcApplet);
+
+ mcApplet.setStub(appletWrap);
+
try {
setIconImage(ImageIO.read(new File("icon.png")));
} catch (IOException e) {
@@ -53,7 +55,6 @@ public final class LegacyFrame extends Frame {
}
public void start (
- Applet mcApplet,
String user,
String session,
int winSizeW,
@@ -62,14 +63,14 @@ public final class LegacyFrame extends Frame {
String serverAddress,
String serverPort
) {
- try {
- appletWrap = new Launcher(mcApplet, new URL("http://www.minecraft.net/game"));
- } catch (MalformedURLException ignored) {}
-
// Implements support for launching in to multiplayer on classic servers using a mpticket
// file generated by an external program and stored in the instance's root folder.
- Path mpticketFile = Paths.get(System.getProperty("user.dir") + "/../mpticket");
- Path mpticketFileCorrupt = Paths.get(System.getProperty("user.dir") + "/../mpticket.corrupt");
+
+ Path mpticketFile =
+ Paths.get(System.getProperty("user.dir"), "..", "mpticket");
+
+ Path mpticketFileCorrupt =
+ Paths.get(System.getProperty("user.dir"), "..", "mpticket.corrupt");
if (Files.exists(mpticketFile)) {
try (Scanner fileScanner = new Scanner(
@@ -115,8 +116,6 @@ public final class LegacyFrame extends Frame {
appletWrap.setParameter("demo", "false");
appletWrap.setParameter("fullscreen", "false");
- mcApplet.setStub(appletWrap);
-
add(appletWrap);
appletWrap.setPreferredSize(new Dimension(winSizeW, winSizeH));