2021-05-01 02:05:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
cd ..
|
2021-05-01 05:42:15 +02:00
|
|
|
basedir="$(cd .. && pwd -P)"
|
2021-05-01 02:05:41 +02:00
|
|
|
|
2021-05-01 05:42:15 +02:00
|
|
|
source $basedir/mappings/scripts/source.sh
|
2021-05-01 02:05:41 +02:00
|
|
|
|
|
|
|
do_fixes(){
|
|
|
|
find -name '*.java' | xargs --max-procs=4 --no-run-if-empty sed -i '/^import [a-zA-Z0-9]*;$/d'
|
|
|
|
}
|
|
|
|
|
2021-05-01 05:42:15 +02:00
|
|
|
cd ${basedir}/mappings/mapper
|
2021-05-01 02:05:41 +02:00
|
|
|
./gradlew installDist
|
|
|
|
cd "$basedir"
|
|
|
|
|
|
|
|
|
|
|
|
echo "Copying files for the 'Base' Folder"
|
2021-05-01 05:42:15 +02:00
|
|
|
rm -fr $basedir/mappings/work/Base
|
|
|
|
mkdir -p $basedir/mappings/work/Base/src/main/java/com/mojang
|
|
|
|
bash -c "cp -r ${basedir}/${inputdirprefix}Server/src/main/java/* ${basedir}/mappings/work/Base/src/main/java/"
|
2021-05-01 02:05:41 +02:00
|
|
|
# bash -c "cp -r ${basedir}/${inputdirprefix}API/src/main/java/* Base/src/main/java/"
|
|
|
|
mcver=$(cat "$paperdir/work/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
|
|
|
|
2021-05-01 05:42:15 +02:00
|
|
|
cp -r ${basedir}/${paperdir}/work/Minecraft/"${mcver}"/libraries/com.mojang/*/* ${basedir}/mappings/work/Base/src/main/java/
|
2021-05-01 02:05:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo "Setting up 'Mapped' Folder"
|
2021-05-01 05:42:15 +02:00
|
|
|
rm -fr $basedir/mappings/work/Yatopia-Server_yarn_unpatched
|
|
|
|
mkdir -p $basedir/mappings/work/Yatopia-Server_yarn_unpatched/src/main/java
|
2021-05-01 02:05:41 +02:00
|
|
|
echo "Remapping...."
|
2021-05-01 05:42:15 +02:00
|
|
|
cp "${basedir}/${inputdirprefix}Server/.gitignore" "${basedir}/${inputdirprefix}Server/pom.xml" "${basedir}/${inputdirprefix}Server/checkstyle.xml" "${basedir}/${inputdirprefix}Server/CONTRIBUTING.md" "${basedir}/${inputdirprefix}Server/LGPL.txt" "${basedir}/${inputdirprefix}Server/LICENCE.txt" "${basedir}/${inputdirprefix}Server/README.md" mappings/work/Yatopia-Server_yarn_unpatched/
|
2021-05-01 02:05:41 +02:00
|
|
|
|
2021-05-01 05:42:15 +02:00
|
|
|
JAVA_OPTS="-Xms1G -Xmx2G" ${basedir}/mappings/mapper/build/install/mapper/bin/mapper ${basedir}/mappings/map.srg ${basedir}/mappings/work/Base/src/main/java ${basedir}/mappings/work/Yatopia-Server_yarn_unpatched/src/main/java
|
2021-05-01 02:05:41 +02:00
|
|
|
|
|
|
|
echo "Applying fixes..."
|
2021-05-01 05:42:15 +02:00
|
|
|
cd "$basedir"/mappings/work/Yatopia-Server_yarn_unpatched/src/main/java
|
2021-05-01 02:05:41 +02:00
|
|
|
do_fixes
|
|
|
|
|
2021-05-01 05:42:15 +02:00
|
|
|
cd "$basedir"/mappings/work/Yatopia-Server_yarn_unpatched
|
2021-05-01 02:05:41 +02:00
|
|
|
git init
|
|
|
|
git add .
|
|
|
|
git commit --quiet --message=init
|
|
|
|
cd "$basedir"
|