2020-07-15 20:49:36 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-08-03 18:48:42 +02:00
|
|
|
echo "[Yatopia] State: Generate Imports"
|
2020-07-15 20:49:36 +02:00
|
|
|
|
|
|
|
# For a description of this script, see updateUpstream.sh.
|
|
|
|
|
|
|
|
# get base dir regardless of execution location
|
|
|
|
basedir=$1
|
|
|
|
|
|
|
|
source "$basedir/scripts/functions.sh"
|
|
|
|
|
|
|
|
paperworkdir="$basedir/Tuinity/Paper/work"
|
|
|
|
minecraftversion=$(cat $paperworkdir/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
|
|
|
|
decompile="$paperworkdir/Minecraft/$minecraftversion/spigot"
|
|
|
|
|
|
|
|
# create dev dir
|
|
|
|
basedir
|
|
|
|
mkdir -p mc-dev/src/net/minecraft/server
|
|
|
|
cd mc-dev
|
|
|
|
|
|
|
|
# prepare to push
|
|
|
|
if [ ! -d ".git" ]; then
|
2020-09-02 11:45:06 +02:00
|
|
|
$gitcmd init
|
2020-07-15 20:49:36 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# reset dev files to raw nms in spigot naming
|
|
|
|
rm src/net/minecraft/server/*.java
|
|
|
|
cp $decompile/net/minecraft/server/*.java src/net/minecraft/server
|
|
|
|
|
|
|
|
# diff and only preserve new added files
|
|
|
|
paperserver="$basedir/Tuinity/Tuinity-Server/src/main/java/net/minecraft/server"
|
|
|
|
cd $basedir/mc-dev/src/net/minecraft/server/
|
|
|
|
|
2020-09-02 11:45:06 +02:00
|
|
|
for file in $(/bin/ls $paperserver); do
|
|
|
|
if [ -f "$file" ]; then
|
|
|
|
rm -f "$file"
|
|
|
|
fi
|
2020-07-15 20:49:36 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# push the dev project
|
|
|
|
cd $basedir/mc-dev
|
|
|
|
$gitcmd add . -A
|
2020-08-03 18:48:42 +02:00
|
|
|
$gitcmd commit . -m "Yatopia-base"
|
|
|
|
$gitcmd tag -a "Yatopia-base" -m "Yatopia-base" 2>/dev/null
|
2020-07-15 20:49:36 +02:00
|
|
|
# gitpush . $MCDEV_REPO $paperVer
|