forked from Steel-Foundation/SteelMC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-minecraft-src.sh
More file actions
executable file
·29 lines (22 loc) · 1003 Bytes
/
update-minecraft-src.sh
File metadata and controls
executable file
·29 lines (22 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MINECRAFT_SRC_DIR="$SCRIPT_DIR/minecraft-src"
# Create temp directory on same filesystem to avoid cross-device link errors
TEMP_DIR="$SCRIPT_DIR/.gitcraft-tmp"
rm -rf "$TEMP_DIR"
mkdir -p "$TEMP_DIR"
echo "Cloning GitCraft into $TEMP_DIR..."
# Cleanup on exit
trap "rm -rf $TEMP_DIR" EXIT
# Clone GitCraft
git clone https://github.com/WinPlay02/GitCraft "$TEMP_DIR/GitCraft"
# Patch Groovy version (use specific version instead of dynamic 5.0.+)
sed -i 's/groovy_version = 5\.0\.+/groovy_version = 5.0.0/' "$TEMP_DIR/GitCraft/gradle.properties"
echo "Patched gradle.properties:"
grep groovy "$TEMP_DIR/GitCraft/gradle.properties"
# Run GitCraft
cd "$TEMP_DIR/GitCraft"
echo "Running GitCraft..."
JAVA_TOOL_OPTIONS="-Xmx8G" ./gradlew run --args="--override-repo-target=$MINECRAFT_SRC_DIR --only-unobfuscated --mappings=identity_unmapped --min-version=1.21.11 --only-stable"
echo "Done! minecraft-src has been updated."