2016-04-02 03:55:54 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-03-09 03:08:16 +00:00
|
|
|
|
2016-04-03 07:23:19 +00:00
|
|
|
(
|
|
|
|
set -e
|
2016-03-09 03:08:16 +00:00
|
|
|
PS1="$"
|
|
|
|
|
2016-04-03 08:35:51 +00:00
|
|
|
basedir="$(cd "$1" && pwd -P)"
|
2018-08-14 23:59:53 +00:00
|
|
|
cd "$basedir"
|
2016-04-02 03:55:54 +00:00
|
|
|
workdir="$basedir/work"
|
2016-04-03 21:58:15 +00:00
|
|
|
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
|
2017-08-12 23:56:59 +00:00
|
|
|
decompiledir="$workdir/Minecraft/$minecraftversion"
|
2018-08-31 22:56:57 +00:00
|
|
|
nms="$decompiledir/forge/net/minecraft/server"
|
2016-04-02 03:55:54 +00:00
|
|
|
papernms="Paper-Server/src/main/java/net/minecraft/server"
|
|
|
|
mcdevsrc="${decompiledir}/src/net/minecraft/server"
|
2016-03-09 03:08:16 +00: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";
|
2016-04-03 07:23:19 +00:00
|
|
|
)
|