Skip to content

Instantly share code, notes, and snippets.

@jaqque
Created September 9, 2014 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaqque/82efab552f2e25daf1e8 to your computer and use it in GitHub Desktop.
Save jaqque/82efab552f2e25daf1e8 to your computer and use it in GitHub Desktop.
Helper script for patching SpigotMC
#!/bin/sh
cd `dirname $0`
patcher='SpigotPatcher-1.0.jar'
source='spigot-1649.jar'
md5='f2edc09c45b1f80237602dc0d1b05969'
suffix='.bps'; # not actually used.
patch="$1"
target="${patch%.bps}.jar"
[ -f "$patcher" ] || {
echo 'Download the Spigot patcher'
echo 'http://www.spigotmc.org/spigot-updates/SpigotPatcher-1.0.jar'
exit 1
}
[ -f "$source" ] || {
echo 'Aquire the last Spigot release (#1649). I can'"'"'t help you any further.'
exit 2
}
echo "$md5 $source" | md5sum --check --quiet || exit 1
[ "$patch" ] || {
echo "Must supply binary patch (spigot.bps)"
exit 1
}
[ -f "$patch" ] || {
echo "No such file: $patch"
exit 1
}
[ "$patch" = "${patch%.bps}.bps" ] || {
echo "Are you sure $patch is a binary patch? (.bps)"
exit 1
}
[ ! -f "$target" ] || {
echo "Already built: $target ($(cat $target|md5sum|awk '{print $1}'))"
exit 0
}
java -jar "$patcher" "$source" $1 ${1%.bps}.jar
@jaqque
Copy link
Author

jaqque commented Sep 9, 2014

Put this in the same directory as SpigotPatcher-1.0.jar, spigot-1649.jar, and the spigot.bps.

Prerequisites: java installed, md5sum available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment