Created
June 17, 2014 22:06
-
-
Save WhyNotHugo/25a6e1a86129be9e0270 to your computer and use it in GitHub Desktop.
Run minecraft forcing IPv6 on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.InetAddress; | |
import net.minecraft.bootstrap.Bootstrap; | |
/* | |
* Launches minecraft forcing the usage of IPv6. | |
* You should make sure minecraft.jar is added to the classpath | |
* That's /usr/share/minecraft/minecraft.jar on most distros. | |
* | |
* This wrapper requires no future changes unless Mojang changes | |
* the class containing main() in future. | |
*/ | |
public class MinecraftIPv6 { | |
public static void main(String[] args) throws IOException { | |
// This is an IPv6 launcher, force IPv6, no matter what. | |
System.setProperty("java.net.preferIPv6Addresses", "true"); | |
// Unnecesary?: | |
// System.setProperty("java.net.preferIPv4Stack", "false"); | |
// InetAddress reads on it's first usage. If it's not used here, | |
// Bootstrap will override it before using InetAddress, reverting the | |
// above. | |
InetAddress.getByName(null); | |
// Call the actual game Bootstrap | |
Bootstrap.main(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment