mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 20:46:59 +01:00
9ff170660b
Makes caching easier, ever so slightly more organized.
29 lines
777 B
Bash
Executable File
29 lines
777 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
(
|
|
set -e
|
|
PS1="$"
|
|
|
|
basedir="$(cd "$1" && pwd -P)"
|
|
workdir="$basedir/work"
|
|
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
|
decompiledir="$workdir/Minecraft/$minecraftversion"
|
|
nms="$decompiledir/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";
|
|
)
|