summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Osvaldo Barrera2015-06-09 02:39:50 -0300
committerHugo Osvaldo Barrera2015-06-09 02:39:57 -0300
commitd7658abdb864d94d7e913d182f9d1f0742607de3 (patch)
treeabdc3b1b602b18fd7976cadf7ae22b8a3d0ee191
downloadaur-d7658abdb864d94d7e913d182f9d1f0742607de3.tar.gz
Initial commit.
-rw-r--r--.SRCINFO15
-rw-r--r--Makefile3
-rw-r--r--MinecraftIPv6.java29
-rw-r--r--PKGBUILD22
-rw-r--r--minecraft-ipv6.sh2
5 files changed, 71 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d274eeb4941c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = minecraft-ipv6
+ pkgdesc = A wrapper for the minecraft that does not disable IPv6
+ pkgver = 1.0.0
+ pkgrel = 1
+ url = https://bugs.mojang.com/browse/MC-3776?focusedCommentId=163693&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-163693
+ arch = any
+ license = BSD
+ depends = minecraft
+ source = MinecraftIPv6.java
+ source = minecraft-ipv6.sh
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = minecraft-ipv6
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..6e8d18d7567e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,3 @@
+build:
+ java
+
diff --git a/MinecraftIPv6.java b/MinecraftIPv6.java
new file mode 100644
index 000000000000..063471a8e8ca
--- /dev/null
+++ b/MinecraftIPv6.java
@@ -0,0 +1,29 @@
+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");
+ 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);
+ }
+}
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9736414616d9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,22 @@
+# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io>
+
+pkgname=minecraft-ipv6
+pkgver=1.0.0
+pkgrel=1
+pkgdesc="A wrapper for the minecraft that does not disable IPv6"
+arch=(any)
+url="https://bugs.mojang.com/browse/MC-3776?focusedCommentId=163693&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-163693"
+license=('BSD')
+depends=('minecraft')
+source=(MinecraftIPv6.java minecraft-ipv6.sh)
+md5sums=('SKIP' 'SKIP')
+
+build() {
+ cd "$srcdir"
+ javac -cp "/usr/share/minecraft/Minecraft.jar" MinecraftIPv6.java
+}
+
+package() {
+ install -Dm 644 MinecraftIPv6.class "$pkgdir/usr/share/minecraft/MinecraftIPv6.class"
+ install -Dm 755 minecraft-ipv6.sh "$pkgdir/usr/bin/minecraft-ipv6"
+}
diff --git a/minecraft-ipv6.sh b/minecraft-ipv6.sh
new file mode 100644
index 000000000000..bc356b27bf33
--- /dev/null
+++ b/minecraft-ipv6.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+java -cp "/usr/share/minecraft/Minecraft.jar:/usr/share/minecraft/" MinecraftIPv6