PaperMC/scripts/makemcdevsrc.sh
Timardo 0d098ca00d [CI-SKIP] Update makemcdevsrc.sh (#1950)
[Aikar note] we really should figure out a way to skip CI again :(
2019-04-08 19:55:49 -04:00

29 lines
800 B
Bash
Executable file

#!/usr/bin/env bash
(
set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
cd "$basedir"
workdir="$basedir/work"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
decompiledir="$workdir/Minecraft/$minecraftversion"
nms="$decompiledir/spigot/net/minecraft/server"
papernms="Paper-Server/src/main/java/net/minecraft/server"
mcdevsrc="${decompiledir}/src/net/minecraft/server"
rm -rf "${mcdevsrc}"
mkdir -p "${mcdevsrc}"
cp "${nms}"/*.java "${mcdevsrc}/"
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";
)