summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorMariell Hoversholm <[email protected]>2021-03-16 17:35:55 +0100
committerMariell Hoversholm <[email protected]>2021-03-18 18:03:22 +0100
commit39b125771663b5359b0aa1cac1f2da47ef794944 (patch)
tree4e25f65bd5bb2097297afe8aed2ac01e64530341 /scripts
parent956150da7ffbd2569afd504d894d5565384741a6 (diff)
downloadPaper-39b125771663b5359b0aa1cac1f2da47ef794944.tar.gz
Paper-39b125771663b5359b0aa1cac1f2da47ef794944.zip
Use revision file
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/decompile.sh3
-rwxr-xr-xscripts/remap.sh18
2 files changed, 12 insertions, 9 deletions
diff --git a/scripts/decompile.sh b/scripts/decompile.sh
index d90a6de9da..53a761bcc1 100755
--- a/scripts/decompile.sh
+++ b/scripts/decompile.sh
@@ -5,6 +5,7 @@ set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
+revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
windows="$([[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]] && echo "true" || echo "false")"
decompiledir="$workdir/Minecraft/$minecraftversion"
@@ -73,7 +74,7 @@ if [ ! -d "$classdir" ]; then
mkdir -p "$classdir"
cd "$classdir"
set +e
- jar xf "$decompiledir/$minecraftversion-mapped.jar" net/minecraft
+ jar xf "$decompiledir/$minecraftversion-$revision-mapped.jar" net/minecraft
if [ "$?" != "0" ]; then
cd "$basedir"
echo "Failed to extract NMS classes."
diff --git a/scripts/remap.sh b/scripts/remap.sh
index 5fb81db1fa..3caf44a588 100755
--- a/scripts/remap.sh
+++ b/scripts/remap.sh
@@ -5,7 +5,8 @@ set -e
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
-minecraftversion="$(cat "${workdir}/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)"-R0.2
+revision="$(cat "$basedir"/revision.txt | tr -d '\n')"
+minecraftversion="$(cat "${workdir}/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)"
minecraftserverurl=$(cat "${workdir}/BuildData/info.json" | grep serverUrl | cut -d '"' -f 4)
minecrafthash=$(cat "${workdir}/BuildData/info.json" | grep minecraftHash | cut -d '"' -f 4)
accesstransforms="$workdir/BuildData/mappings/"$(cat "${workdir}/BuildData/info.json" | grep accessTransforms | cut -d '"' -f 4)
@@ -43,9 +44,10 @@ if [ "$checksum" != "$minecrafthash" ]; then
exit 1
fi
+# These specialsource commands are from https://hub.spigotmc.org/stash/projects/SPIGOT/repos/builddata/browse/info.json
echo "Applying class mappings..."
-if [ ! -f "$jarpath-cl.jar" ]; then
- java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-cl.jar" 1>/dev/null
+if [ ! -f "$jarpath-$revision-cl.jar" ]; then
+ java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/minecraft/math --auto-lvt BASIC --auto-member SYNTHETIC -i "$jarpath.jar" -m "$classmappings" -o "$jarpath-$revision-cl.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply class mappings."
exit 1
@@ -53,8 +55,8 @@ if [ ! -f "$jarpath-cl.jar" ]; then
fi
echo "Applying member mappings..."
-if [ ! -f "$jarpath-m.jar" ]; then
- java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --auto-member LOGGER --auto-member TOKENS -i "$jarpath-cl.jar" -m "$membermappings" -o "$jarpath-m.jar" 1>/dev/null
+if [ ! -f "$jarpath-$revision-m.jar" ]; then
+ java -jar "$workdir/BuildData/bin/SpecialSource-2.jar" map --only . --only net/minecraft --only com/minecraft/math --auto-member LOGGER --auto-member TOKENS -i "$jarpath-$revision-cl.jar" -m "$membermappings" -o "$jarpath-$revision-m.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to apply member mappings."
exit 1
@@ -62,8 +64,8 @@ if [ ! -f "$jarpath-m.jar" ]; then
fi
echo "Creating remapped jar..."
-if [ ! -f "$jarpath-mapped.jar" ]; then
- java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft -i "$jarpath-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-mapped.jar" 1>/dev/null
+if [ ! -f "$jarpath-$revision-mapped.jar" ]; then
+ java -jar "$workdir/BuildData/bin/SpecialSource.jar" --only . --only net/minecraft --only com/minecraft/math -i "$jarpath-$revision-m.jar" --access-transformer "$accesstransforms" -m "$packagemappings" -o "$jarpath-$revision-mapped.jar" 1>/dev/null
if [ "$?" != "0" ]; then
echo "Failed to create remapped jar."
exit 1
@@ -72,7 +74,7 @@ fi
echo "Installing remapped jar..."
cd "$workdir/CraftBukkit" # Need to be in a directory with a valid POM at the time of install.
-mvn install:install-file -q -Dfile="$jarpath-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-SNAPSHOT"
+mvn install:install-file -q -Dfile="$jarpath-$revision-mapped.jar" -Dpackaging=jar -DgroupId=io.papermc -DartifactId=minecraft-server -Dversion="$minecraftversion-$revision-SNAPSHOT"
if [ "$?" != "0" ]; then
echo "Failed to install remapped jar."
exit 1