aboutsummaryrefslogtreecommitdiff
path: root/bin/decompile
blob: 68a5546c3b0fdd04cc7dbfdefc9235ac539fa063 (plain) (blame)
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
#!/usr/bin/env bash

main() {
	# Replace this with your local path to worlds.jar
	local WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR:-"${HOME}/.local/share/bottles/bottles/WorldsPlayer/drive_c/Program Files (x86)/Worlds Inc/WorldsPlayer - BowieFull/lib/worlds.jar"}

	echo "Using WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR}"

	vineflower --explicit-generics=true "${WORLDSPLAYER_JAR}" source

	if command -v git &>/dev/null; then
		cd source || exit

		# Initialise from decompiled source
		git init
		git add .
		git commit -m "Initial commit" --no-gpg-sign

		# Apply source patches
		git apply ../*.patch
		git add .
		git commit -m "Source patches" --no-gpg-sign

		cd ..
	fi
}

main