2016-04-02 05:55:54 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-03-09 04:08:16 +01:00
|
|
|
|
2016-04-03 09:23:19 +02:00
|
|
|
(
|
|
|
|
set -e
|
2016-03-09 04:08:16 +01:00
|
|
|
PS1="$"
|
|
|
|
|
2016-04-03 10:35:51 +02:00
|
|
|
basedir="$(cd "$1" && pwd -P)"
|
2018-08-15 01:59:53 +02:00
|
|
|
cd "$basedir"
|
2016-04-02 05:55:54 +02:00
|
|
|
workdir="$basedir/work"
|
2021-03-16 18:30:17 +01:00
|
|
|
revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
|
2016-04-03 23:58:15 +02:00
|
|
|
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
2021-03-16 18:30:17 +01:00
|
|
|
decompiledir="$workdir/Minecraft/$minecraftversion-$revision"
|
2019-02-10 21:43:40 +01:00
|
|
|
nms="$decompiledir/spigot/net/minecraft/server"
|
2016-04-02 05:55:54 +02:00
|
|
|
papernms="Paper-Server/src/main/java/net/minecraft/server"
|
|
|
|
mcdevsrc="${decompiledir}/src/net/minecraft/server"
|
2016-03-09 04:08:16 +01:00
|
|
|
rm -rf "${mcdevsrc}"
|
|
|
|
mkdir -p "${mcdevsrc}"
|
2019-04-23 06:47:07 +02:00
|
|
|
find ${nms} -name *.java -print0 | xargs -I\{} -0 cp \{} "${mcdevsrc}/"
|
2016-03-09 04:08:16 +01:00
|
|
|
|
|
|
|
for file in "${nms}/"*
|
|
|
|
do
|
|
|
|
file=${file##*/}
|
|
|
|
# test if in Paper folder - already imported
|
|
|
|
if [ -f "${papernms}/${file}" ]; then
|
|
|
|
# remove from mcdevsrc folder
|
|
|
|
rm -f "${mcdevsrc}/${file}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo "Built $decompiledir/src to be included in your project for src access";
|
2016-04-03 09:23:19 +02:00
|
|
|
)
|