Yatopia/scripts/installLauncher.sh

32 lines
1.1 KiB
Bash
Raw Normal View History

2020-07-15 20:49:36 +02:00
#!/usr/bin/env bash
# SCRIPT HEADER start
basedir=$1
source "$basedir/scripts/functions.sh"
echo " "
echo "----------------------------------------"
echo " $(bashcolor 1 32)Task$(bashcolorend) - Install Launcher"
echo " This will build a launcher that similar to Paperclip by the server jar."
echo " "
echo "----------------------------------------"
# SCRIPT HEADER end
# Copied from https://github.com/PaperMC/Paper/blob/d54ce6c17fb7a35238d6b9f734d30a4289886773/scripts/paperclip.sh
# License from Paper applies to this file
set -e
paperworkdir="$basedir/Tuinity/Paper/work"
mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
2020-07-15 23:39:10 +02:00
serverjar="$basedir/YAPFA-Server/target/yapfa-$mcver.jar"
2020-07-15 20:49:36 +02:00
vanillajar="$paperworkdir/Minecraft/$mcver/$mcver.jar"
(
cd "$paperworkdir/Paperclip"
mvn clean package "-Dmcver=$mcver" "-Dpaperjar=$serverjar" "-Dvanillajar=$vanillajar"
)
mkdir -p "$basedir/target"
2020-07-15 21:32:56 +02:00
cp "$paperworkdir/Paperclip/assembly/target/paperclip-${mcver}.jar" "$basedir/target/YAPFA-${mcver}-paperclip.jar"
2020-07-15 20:49:36 +02:00
echo ""
echo " $(bashcolor 1 32)Success$(bashcolorend) - Saved launcher jar to target/YAPFA-${mcver}-launcher.jar"