2016-04-02 11:55:54 +08:00
|
|
|
#!/usr/bin/env bash
|
2016-03-09 11:08:16 +08:00
|
|
|
|
|
|
|
PS1="$"
|
|
|
|
|
2016-04-03 07:34:27 +08:00
|
|
|
basedir=$(realpath "$1")
|
2016-04-02 11:55:54 +08:00
|
|
|
workdir="$basedir/work"
|
|
|
|
minecraftversion=$(cat "$basedir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
|
|
|
decompiledir="$workdir/$minecraftversion"
|
|
|
|
nms="$decompiledir/net/minecraft/server"
|
|
|
|
papernms="Paper-Server/src/main/java/net/minecraft/server"
|
|
|
|
mcdevsrc="${decompiledir}/src/net/minecraft/server"
|
2016-03-09 11:08:16 +08:00
|
|
|
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";
|