summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xminecraft21
3 files changed, 24 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ea210354caf..a44dd26504b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = minecraft
pkgdesc = An open-world game whose gameplay revolves around breaking and placing blocks
pkgver = latest
- pkgrel = 25
+ pkgrel = 26
url = http://www.minecraft.net/
install = minecraft.install
arch = any
@@ -17,7 +17,7 @@ pkgbase = minecraft
source = minecraft.png
source = minecraft.install
source = LICENSE
- md5sums = b8d4ebcdc3f32f857270a56c40ff2c66
+ md5sums = b0795db46de753b74b44bed380b2cf94
md5sums = 85273e24404cc6865805f951487b8a1e
md5sums = ecb1bd9b6e6305987b6fb5832ab0b468
md5sums = dfecf76f9db4497399f4b7c171150c89
diff --git a/PKGBUILD b/PKGBUILD
index b8f3889501f..46407b06c50 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# CVS for PKGBUILD is available at https://github.com/christopherobin/pkgbuilds/tree/master/minecraft
pkgname=minecraft
pkgver=latest
-pkgrel=25
+pkgrel=26
pkgdesc="An open-world game whose gameplay revolves around breaking and placing blocks"
arch=(any)
license=('custom')
@@ -11,7 +11,7 @@ depends=('java-runtime' 'xorg-xrandr' 'ttf-font' 'libxtst')
noextract=('minecraft.jar')
source=(minecraft http://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar
minecraft.desktop minecraft.png minecraft.install LICENSE)
-md5sums=('b8d4ebcdc3f32f857270a56c40ff2c66'
+md5sums=('b0795db46de753b74b44bed380b2cf94'
'85273e24404cc6865805f951487b8a1e'
'ecb1bd9b6e6305987b6fb5832ab0b468'
'dfecf76f9db4497399f4b7c171150c89'
diff --git a/minecraft b/minecraft
index 3d87bec21f9..5d27e917394 100755
--- a/minecraft
+++ b/minecraft
@@ -1,7 +1,26 @@
#!/bin/sh
-if [ -e "${HOME}/.minecraft/launcher.jar" ]; then
+# Since launching the minecraft launch from the home directory bypass the update mechanism, I'm adding this
+# small piece of code that will do a checksum of the versions.json file provided by mojang, if a new version
+# of the game is out, I force a download of the launcher just to keep everyone up to date
+
+# those 2 can be overrided if you want
+MC_VERSION_URL=${MC_VERSION_URL:-"https://launchermeta.mojang.com/mc/game/version_manifest.json"}
+MC_SUM_FILE=${MC_SUM_FILE:-"${HOME}/.minecraft/versions.sum"}
+
+# compute sums
+MC_VERSION_SUM=$( curl -s https://launchermeta.mojang.com/mc/game/version_manifest.json | sha256sum | cut -f 1 -d " " )
+MC_CURRENT_SUM=$( cat "$MC_SUM_FILE" 2>/dev/null )
+
+if [ "$MC_VERSION_SUM" != "$MC_CURRENT_SUM" ]; then
+ export MC_FORCE_UPDATE=1
+ echo "$MC_VERSION_SUM" > "$MC_SUM_FILE"
+fi
+
+if [ -e "${HOME}/.minecraft/launcher.jar" ] && [ -z "$MC_FORCE_UPDATE" ]; then
exec java -jar "${HOME}/.minecraft/launcher.jar" $@
else
exec java -jar /usr/share/minecraft/Minecraft.jar $@
fi
+
+unset MC_FORCE_UPDATE \ No newline at end of file