2015-12-30 05:40:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PS1="$"
|
|
|
|
basedir=`pwd`
|
2016-03-31 03:27:13 +02:00
|
|
|
workdir="$basedir/work"
|
2015-12-30 05:40:32 +01:00
|
|
|
minecraftversion=$(cat BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
2016-03-31 03:27:13 +02:00
|
|
|
decompiledir="$workdir/$minecraftversion"
|
|
|
|
nms="$decompiledir/net/minecraft/server"
|
2015-12-30 05:40:32 +01:00
|
|
|
cb=src/main/java/net/minecraft/server
|
|
|
|
|
2016-03-31 03:27:13 +02:00
|
|
|
paperjar="$basedir/Paper-Server/target/paper-${minecraftversion}.jar"
|
|
|
|
vanillajar="${decompiledir}/${minecraftversion}.jar"
|
|
|
|
|
|
|
|
echo -e "mcver=${minecraftversion}\npaperjar=${paperjar}\nvanillajar=${vanillajar}" > paperclip.properties
|
|
|
|
|
2015-12-30 05:40:32 +01:00
|
|
|
patch=$(which patch 2>/dev/null)
|
|
|
|
if [ "x$patch" == "x" ]; then
|
|
|
|
patch=$basedir/hctap.exe
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Applying CraftBukkit patches to NMS..."
|
|
|
|
cd "$basedir/CraftBukkit"
|
|
|
|
git checkout -B patched HEAD >/dev/null 2>&1
|
|
|
|
rm -rf $cb
|
|
|
|
mkdir -p $cb
|
|
|
|
for file in $(ls nms-patches)
|
|
|
|
do
|
|
|
|
patchFile="nms-patches/$file"
|
|
|
|
file="$(echo $file | cut -d. -f1).java"
|
|
|
|
|
|
|
|
echo "Patching $file < $patchFile"
|
|
|
|
sed -i 's/\r//' "$nms/$file" > /dev/null
|
|
|
|
|
|
|
|
cp "$nms/$file" "$cb/$file"
|
|
|
|
"$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
|
|
|
|
done
|
|
|
|
|
2016-03-25 01:39:20 +01:00
|
|
|
git add src >/dev/null 2>&1 || exit 1
|
|
|
|
git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 || exit 1
|
|
|
|
git checkout -f HEAD^ >/dev/null 2>&1 || exit 1
|