mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
[CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389)
This commit is contained in:
parent
7fb24d323a
commit
6f0d20d436
1 changed files with 11 additions and 11 deletions
|
@ -5,25 +5,25 @@ set -e
|
||||||
PS1="$"
|
PS1="$"
|
||||||
|
|
||||||
basedir="$(cd "$1" && pwd -P)"
|
basedir="$(cd "$1" && pwd -P)"
|
||||||
cd "$basedir"
|
|
||||||
workdir="$basedir/work"
|
workdir="$basedir/work"
|
||||||
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
||||||
decompiledir="$workdir/Minecraft/$minecraftversion"
|
decompiledir="$workdir/Minecraft/$minecraftversion"
|
||||||
nms="$decompiledir/spigot/net/minecraft/server"
|
nms="$decompiledir/spigot/net/minecraft"
|
||||||
papernms="Paper-Server/src/main/java/net/minecraft/server"
|
papernms="$basedir/Paper-Server/src/main/java/net/minecraft"
|
||||||
mcdevsrc="${decompiledir}/src/net/minecraft/server"
|
mcdevsrc="${decompiledir}/src/net/minecraft"
|
||||||
rm -rf "${mcdevsrc}"
|
rm -rf "${mcdevsrc}"
|
||||||
mkdir -p "${mcdevsrc}"
|
mkdir -p "${mcdevsrc}"
|
||||||
find ${nms} -name *.java -print0 | xargs -I\{} -0 cp \{} "${mcdevsrc}/"
|
cd "${nms}"
|
||||||
|
|
||||||
for file in "${nms}/"*
|
for file in $(find . -name '*.java')
|
||||||
do
|
do
|
||||||
file=${file##*/}
|
if [ ! -f "${papernms}/${file}" ]; then
|
||||||
# test if in Paper folder - already imported
|
destdir="${mcdevsrc}"/$(dirname "${file}")
|
||||||
if [ -f "${papernms}/${file}" ]; then
|
mkdir -p "${destdir}"
|
||||||
# remove from mcdevsrc folder
|
cp "${file}" "${destdir}"
|
||||||
rm -f "${mcdevsrc}/${file}"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
cd "$basedir"
|
||||||
echo "Built $decompiledir/src to be included in your project for src access";
|
echo "Built $decompiledir/src to be included in your project for src access";
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue