diff options
author | Black Hole <[email protected]> | 2021-03-21 05:07:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-21 04:07:14 +0000 |
commit | e27f334bb2c6db5dea463da5f94e9dca0f997bb9 (patch) | |
tree | a8e906345294c4d8141851c0c52c307557c52c56 /scripts | |
parent | ae15e85da4317fc7dc118648cae1964db33129a9 (diff) | |
download | Paper-e27f334bb2c6db5dea463da5f94e9dca0f997bb9.tar.gz Paper-e27f334bb2c6db5dea463da5f94e9dca0f997bb9.zip |
[CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/makemcdevsrc.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/makemcdevsrc.sh b/scripts/makemcdevsrc.sh index dd4c4e48aa..bd86947f8d 100755 --- a/scripts/makemcdevsrc.sh +++ b/scripts/makemcdevsrc.sh @@ -5,25 +5,25 @@ 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" +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}" -find ${nms} -name *.java -print0 | xargs -I\{} -0 cp \{} "${mcdevsrc}/" +cd "${nms}" -for file in "${nms}/"* +for file in $(find . -name '*.java') do - file=${file##*/} - # test if in Paper folder - already imported - if [ -f "${papernms}/${file}" ]; then - # remove from mcdevsrc folder - rm -f "${mcdevsrc}/${file}" + 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"; ) |