Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-21 05:50:05 +01:00
9ff170660b
Makes caching easier, ever so slightly more organized.
34 Zeilen
897 B
Bash
Ausführbare Datei
34 Zeilen
897 B
Bash
Ausführbare Datei
#!/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"
|
|
classdir="$decompiledir/classes"
|
|
|
|
echo "Extracting NMS classes..."
|
|
if [ ! -d "$classdir" ]; then
|
|
mkdir -p "$classdir"
|
|
cd "$classdir"
|
|
jar xf "$decompiledir/$minecraftversion-mapped.jar" net/minecraft/server
|
|
if [ "$?" != "0" ]; then
|
|
cd "$basedir"
|
|
echo "Failed to extract NMS classes."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "Decompiling classes..."
|
|
if [ ! -d "$decompiledir/net/minecraft/server" ]; then
|
|
cd "$basedir"
|
|
java -jar "$workdir/BuildData/bin/fernflower.jar" -dgs=1 -hdc=0 -asc=1 -udv=0 "$classdir" "$decompiledir"
|
|
if [ "$?" != "0" ]; then
|
|
echo "Failed to decompile classes."
|
|
exit 1
|
|
fi
|
|
fi
|
|
)
|