Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use RetroMCP, Add makefile, update README.md #8

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
70510b0
Create Makefile
2zqa Jul 8, 2023
dfdb774
Fix source code copying
2zqa Jul 8, 2023
513dfa3
Move src to project root
2zqa Jul 8, 2023
33d8089
Update Makefile variables and cleanup
2zqa Jul 8, 2023
e0dec46
Add client.patch
2zqa Jul 8, 2023
413edd2
Remove old source files
2zqa Jul 8, 2023
dc1fd3a
Update .gitignore
2zqa Jul 8, 2023
0d43ca5
Add createpatch and compile recipes
2zqa Jul 8, 2023
16de528
Remove old leftover source file
2zqa Jul 8, 2023
677705d
Update Makefile to automatically apply patch
2zqa Jul 8, 2023
1a3b855
Remove superseded createmod.sh
2zqa Jul 8, 2023
5e0e58e
Update clean to also remove exported mod
2zqa Jul 8, 2023
9a6c2d9
Rename modloader_bin
2zqa Jul 8, 2023
0d6bab4
Also remove RetroMCP bin upon cleaning
2zqa Jul 8, 2023
577816a
Rename setupwithoutapply
2zqa Jul 8, 2023
2e65483
Remove unneeded comment
2zqa Jul 8, 2023
5397691
Make mod name a variable
2zqa Jul 9, 2023
480c653
Split off setup from decompile step
2zqa Jul 9, 2023
b05f199
Fix space
2zqa Jul 9, 2023
6426262
Clean up
2zqa Jul 9, 2023
5ad21ed
Rename compile to actual file name of output
2zqa Jul 9, 2023
045409d
Don't re-download if files already exist
2zqa Jul 9, 2023
a29bfab
Move setup to download recipe
2zqa Jul 9, 2023
12aa963
Rename createpatch to patch
2zqa Jul 9, 2023
3f50898
Remove modloader variables, remove test in download
2zqa Jul 9, 2023
5033692
Fix .PHONY for patch
2zqa Jul 9, 2023
f0682fa
Use jar instead of zip program in applymodloader
2zqa Jul 9, 2023
99b5446
Fix default recipe referring to old recipe name
2zqa Jul 9, 2023
15372da
Fix applymodloader
2zqa Jul 15, 2023
0641c85
Update readme instructions
2zqa Jul 25, 2023
f4d0b78
Fix making of mod zip file
2zqa Jul 25, 2023
f3d5ef7
Add vscode configuration
2zqa Jul 25, 2023
eb293c0
Update banner image
2zqa Aug 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 7 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,52 +1,14 @@
# Block folders that belong to MCP
jars/
logs/
reobf/
temp/
bin/

# Block folders that belong to RetroMCP
conf/
docs/
eclipse/
runtime/
notes.md
jars/
libraries/
minecraft/
minecraft_server/
RetroMCP-Java-CLI.jar

# AnnoyanceFix related stuff
src/minecraft_server
src/minecraft/net/minecraft/client
src/minecraft/net/minecraft/isom
src/minecraft/net/minecraft/src/*.java
!src/minecraft/net/minecraft/src/BlockFence.java
!src/minecraft/net/minecraft/src/BlockStairs.java
!src/minecraft/net/minecraft/src/InventoryPlayerUtils.java
!src/minecraft/net/minecraft/src/EntityBoat.java
!src/minecraft/net/minecraft/src/mod_AnnoyanceFix.java
AnnoyanceFix.zip

# Allow server.properties
!jars/server.properties

# Block compiled Python
*.pyc

# Block downloaded files
runtime/bin/pypy*
!runtime/bin/

# Block .idea folder
# IDE stuff
.idea/

# Block python runtime.
runtime/bin/python/

# Block command file.
runtime/command

# Block scripts in the root folder except setup.* and createmod.*
*.bat
*.sh
!createmod.sh
!createmod.bat

# Block .iml files
*.iml
71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
RETRO_MCP_DL=https://github.com/MCPHackers/RetroMCP-Java/releases/latest/download/RetroMCP-Java-CLI.jar
MODLOADER_DL=https://github.com/coffeenotfound/ModloaderFix-b1.7.3/releases/download/v1.0.0/ModLoader.Fix.b1.7.3-1.0.0.jar
MOD_NAME=AnnoyanceFix

tmp_dir=/tmp
wget_flags=-q --show-progress
retro_mcp_bin=RetroMCP-Java-CLI.jar
vscode_config='{ \
"java.project.sourcePaths": ["src"], \
"java.project.referencedLibraries": [ \
"../libraries/**/*.jar" \
] \
}'


.PHONY: default
default: download applymodloader decompile applypatch

# RetroMCP

.PHONY: download
download:
wget $(wget_flags) -O $(retro_mcp_bin) $(RETRO_MCP_DL)
wget $(wget_flags) -O $(tmp_dir)/modloader.jar $(MODLOADER_DL)
java -jar $(retro_mcp_bin) setup b1.7.3

.PHONY: applymodloader
applymodloader:
mkdir $(tmp_dir)/modloader
cd $(tmp_dir)/modloader && jar -xvf ../modloader.jar
mv jars/minecraft.jar $(tmp_dir)/modloader
cd $(tmp_dir)/modloader && jar -uf minecraft.jar *
mv $(tmp_dir)/modloader/minecraft.jar jars/

.PHONY: decompile
decompile:
java -jar $(retro_mcp_bin) decompile
java -jar $(retro_mcp_bin) updatemd5

.PHONY: clean
clean:
java -jar $(retro_mcp_bin) cleanup
# Clean working directory
rm -rf libraries $(MOD_NAME).zip $(retro_mcp_bin) $(tmp_dir)/modloader $(tmp_dir)/modloader.jar

.PHONY: applypatch
applypatch:
java -jar $(retro_mcp_bin) applypatch

.PHONY: patch
patch:
java -jar $(retro_mcp_bin) createpatch

.PHONY: $(MOD_NAME).zip
$(MOD_NAME).zip:
java -jar $(retro_mcp_bin) recompile
java -jar $(retro_mcp_bin) reobfuscate
rm -f $(MOD_NAME).zip
zip -r -j $(MOD_NAME).zip minecraft/reobf

# VSCode

.PHONY: vscode/setup
vscode/setup:
rm minecraft/.project
mkdir minecraft/.vscode
echo $(vscode_config) > minecraft/.vscode/settings.json

.PHONY: vscode/run
vscode/run:
code minecraft
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_Now using modloader!_

![image](https://i.imgur.com/TyufQHz.jpg)
![modloader-banner](https://github.com/2zqa/AnnoyanceFix/assets/25235249/9ea27b70-5396-4b68-8bdf-9e044b2acfaf)

Mod review of v1.4 by Modification Station/The Zyga (thanks!): https://www.youtube.com/watch?v=m8lX9jv9lhI

Expand Down Expand Up @@ -36,19 +36,10 @@ Got any suggestions on what I should add next? Feel free to let me know by [crea

Thanks for considering contributing! To get started:

1. Download 1.7.3-LTS (MCP fork): `https://github.com/ModificationStation/1.7.3-LTS/`
2. Fork this repository
3. Clone your own fork: `git clone https://github.com/<your_username>/AnnoyanceFix.git`
4. Run setup from 1.7.3-LTS
5. Add modloader classes to jars/bin/minecraft.jar
6. Run decompile script with fixed class for Modloader
7. Run updatemd5 script
8. Copy all files _from_ 1.7.3-LTS _to_ the AnnoyanceFix folder, without overwriting anything
9. Fix the errors in Eclipse (mostly replacing int with boolean)
* For example: `int j = this.furnaceBurnTime > 0;` to `boolean j = this.furnaceBurnTime > 0;`
* Remove the int in `int j2 = 4;` in RenderBlocks.java
* Warnings can be ignored
10. Start modding :)
11. Create a pull request when done

TIP: Use the createmod script to automatically recompile, reobfuscate and create a zip for the mod.
1. Fork this repository
2. Clone your own fork: `git clone https://github.com/<your_username>/AnnoyanceFix.git`
3. Run `make`
4. Start modding :)
5. Create a pull request when done

TIP: Run `make AnnoyanceFix.zip` to automatically recompile, reobfuscate and create a zip for the mod.
5 changes: 0 additions & 5 deletions createmod.sh

This file was deleted.

Loading