1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-27 10:19:00 +01:00
PaperMC/scripts/makemcdevsrc.sh

30 lines
736 B
Bash
Raw Normal View History

2016-04-01 22:55:54 -05:00
#!/usr/bin/env bash
(
set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
2016-04-01 22:55:54 -05:00
workdir="$basedir/work"
2016-04-03 17:58:15 -04:00
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
2021-03-16 19:43:56 +01:00
decompiledir="$workdir/Minecraft/$minecraftversion"
nms="$decompiledir/spigot/net/minecraft"
papernms="$basedir/Paper-Server/src/main/java/net/minecraft"
mcdevsrc="${decompiledir}/src/net/minecraft"
rm -rf "${mcdevsrc}"
mkdir -p "${mcdevsrc}"
cd "${nms}"
for file in $(find . -name '*.java')
do
if [ ! -f "${papernms}/${file}" ]; then
destdir="${mcdevsrc}"/$(dirname "${file}")
mkdir -p "${destdir}"
cp "${file}" "${destdir}"
fi
done
cd "$basedir"
echo "Built $decompiledir/src to be included in your project for src access";
)