Skip to content

Commit 683cb65

Browse files
committed
Add tiny mappings generator
1 parent 382ddf0 commit 683cb65

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

mappings/scripts/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp.jar

mappings/scripts/generate-tiny.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
SCRIPT=$(realpath "$0")
4+
SCRIPT_PATH=$(dirname "$SCRIPT")
5+
MAPPINGS_PATH="$(dirname "$SCRIPT_PATH")"
6+
7+
version="$1"
8+
filePath="$MAPPINGS_PATH/arch_$version.tiny"
9+
tmpPath="$SCRIPT_PATH/tmp.jar"
10+
11+
echo "tiny 2 0 official named" > "$filePath"
12+
echo "Fetching https://maven.architectury.dev/dev/architectury/architectury/$version/architectury-$version.jar ..."
13+
curl "https://maven.architectury.dev/dev/architectury/architectury/$version/architectury-$version.jar" -o "$tmpPath"
14+
15+
jar tf "$tmpPath" | while IFS= read -r line; do
16+
if [[ $line == *.class ]]; then
17+
noClass="${line//\.class/}"
18+
remapped="${noClass//dev\//remapped\/}"
19+
echo -e "c\t$noClass\t$remapped" >> "$filePath"
20+
fi
21+
done
22+
23+
rm "$tmpPath"

0 commit comments

Comments
 (0)