diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-10-20 01:02:28 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-10-26 18:23:39 +0200 |
commit | cee53f7f3ceb120aac83dbb60683fb228b385c2e (patch) | |
tree | cd02a5c6a2398b09fdac58e648bdac60ba5f8d63 /libraries | |
parent | 1b4851a941cbafb7bf7a45feee7149cefa7e0acb (diff) | |
download | MultiMC-cee53f7f3ceb120aac83dbb60683fb228b385c2e.tar MultiMC-cee53f7f3ceb120aac83dbb60683fb228b385c2e.tar.gz MultiMC-cee53f7f3ceb120aac83dbb60683fb228b385c2e.tar.lz MultiMC-cee53f7f3ceb120aac83dbb60683fb228b385c2e.tar.xz MultiMC-cee53f7f3ceb120aac83dbb60683fb228b385c2e.zip |
Revert "NOISSUE nuke builtin Minecraft versions"
This reverts commit 5ae3b2c11416eb897a08b0d9531843d0357332f8.
We need those builtin versions for now.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/launcher/org/multimc/onesix/OneSixLauncher.java | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/libraries/launcher/org/multimc/onesix/OneSixLauncher.java b/libraries/launcher/org/multimc/onesix/OneSixLauncher.java index e3e4c283..053e3674 100644 --- a/libraries/launcher/org/multimc/onesix/OneSixLauncher.java +++ b/libraries/launcher/org/multimc/onesix/OneSixLauncher.java @@ -158,8 +158,6 @@ public class OneSixLauncher implements Launcher mcparams.add(Integer.toString(winSize.height)); } - System.setProperty("minecraft.applet.TargetDirectory", cwd); - // Get the Minecraft Class. Class<?> mc; try @@ -183,6 +181,53 @@ public class OneSixLauncher implements Launcher e.printStackTrace(System.err); return -1; } + /* + final java.nio.ByteBuffer[] icons = IconLoader.load("icon.png"); + new Thread() { + public void run() { + ClassLoader cl = ClassLoader.getSystemClassLoader(); + try + { + Class<?> Display; + Method isCreated; + Method setTitle; + Method setIcon; + Field fieldWindowCreated; + Boolean created = false; + Display = cl.loadClass("org.lwjgl.opengl.Display"); + fieldWindowCreated = Display.getDeclaredField("window_created"); + fieldWindowCreated.setAccessible( true ); + setTitle = Display.getMethod("setTitle", String.class); + setIcon = Display.getMethod("setIcon", java.nio.ByteBuffer[].class); + created = (Boolean) fieldWindowCreated.get( null ); + // set the window title? Maybe? + while(!created) + { + try + { + Thread.sleep(150); + created = (Boolean) fieldWindowCreated.get( null ); + } catch (InterruptedException ignored) {} + } + // Give it a bit more time ;) + Thread.sleep(150); + // set the title + setTitle.invoke(null,windowTitle); + // only set icon when there's actually something to set... + if(icons.length > 0) + { + setIcon.invoke(null,(Object)icons); + } + } + catch (Exception e) + { + System.err.println("Couldn't set window icon or title."); + e.printStackTrace(System.err); + } + } + } + .start(); + */ // init params for the main method to chomp on. String[] paramsArray = mcparams.toArray(new String[mcparams.size()]); try |