diff options
| author | Fuwn <[email protected]> | 2024-06-07 23:09:21 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-07 23:11:58 -0700 |
| commit | 5fb40c1cc632c8d064e906f0c4aedc6de35bb8fd (patch) | |
| tree | ead107c12cabbb7421c558731d709725582ba52d | |
| parent | feat(decompile): confirm overwrite (diff) | |
| download | worldsplayer_source_editor-5fb40c1cc632c8d064e906f0c4aedc6de35bb8fd.tar.xz worldsplayer_source_editor-5fb40c1cc632c8d064e906f0c4aedc6de35bb8fd.zip | |
build: add makefile
| -rw-r--r-- | Makefile | 26 | ||||
| -rw-r--r-- | README.md | 20 |
2 files changed, 35 insertions, 11 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d17e93b --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +ifdef JAVAC +else + JAVAC=~/Downloads/jdk1.6.0_45/bin/javac +endif + +ifdef WORLDSPLAYER_JAR +else + WORLDSPLAYER_JAR=${HOME}/.local/share/bottles/bottles/WorldsPlayer/drive_c/Program Files (x86)/Worlds Inc/WorldsPlayer - BowieFull/lib/worlds.jar +endif + +.PHONY: compile decompile install options + +all: options + +compile: + JAVAC=${JAVAC} ./bin/compile + +decompile: + WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR} ./bin/decompile + +install: + cp ./out/worlds.jar "${WORLDSPLAYER_JAR}" + +options: + @echo "JAVAC=${JAVAC}" + @echo "WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR}" @@ -15,16 +15,15 @@ This project additionally requires the ## Decompiling WorldsPlayer -To decompile WorldsPlayer, you will need to run the -[`bin/decompile`](./bin/decompile) script. This script will decompile the full -source tree of the WorldsPlayer Java Archive to the +To decompile WorldsPlayer, you will need to run the `decompile` Make task. This +task will decompile the full source tree of the WorldsPlayer Java Archive to the [`source`](./source) directory. You'll additionally need to provide the location of the WorldsPlayer Java Archive as the `WORLDSPLAYER_JAR` environment variable. ```bash -WORLDSPLAYER_JAR=/path/to/worlds.jar bin/decompile +WORLDSPLAYER_JAR=/path/to/worlds.jar make decompile ``` ## Editing WorldsPlayer @@ -33,16 +32,15 @@ You can edit the decompiled source files in any way you like. ## Recompiling WorldsPlayer -To recompile WorldsPlayer, you will need to run the -[`bin/recompile`](./bin/recompile) script. This script will recompile the full -source tree of the WorldsPlayer Java Archive to the +To recompile WorldsPlayer, you will need to run the `compile` Make task. This +task will recompile the full source tree of the WorldsPlayer Java Archive to the [`out`](./out) directory. You'll additionally need to provide the location of the Java 6 compiler as the `JAVAC` environment variable. ```bash -JAVAC=/path/to/javac bin/recompile +JAVAC=/path/to/javac make compile ``` The recompiled WorldsPlayer Java Archive will be located at @@ -53,16 +51,16 @@ to run in the WorldsPlayer client. ```shell # Decompile WorldsPlayer -WORLDSPLAYER_JAR=/path/to/worlds.jar bin/decompile +WORLDSPLAYER_JAR=/path/to/worlds.jar make decompile # Edit the source files in the source directory find source -type f -name "*.java" -exec sed -i.bak 's/this\.setName(longID);/this.setName(longID + " (" + longID + ")");/' {} \; # Recompile WorldsPlayer -JAVAC=/path/to/javac bin/recompile +JAVAC=/path/to/javac make compile # Copy worlds.jar to your WorldsPlayer client -cp out/worlds.jar /path/to/worlds.jar +WORLDSPLAYER_JAR=/path/to/worlds.jar make install ``` Now that we've changed the username format from `username` to `username (username)`, we can run WorldsPlayer to verify that the change has been applied. |