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

Clarification/Minor Help #17

Open
DarianLStephens opened this issue Oct 31, 2017 · 3 comments
Open

Clarification/Minor Help #17

DarianLStephens opened this issue Oct 31, 2017 · 3 comments
Labels

Comments

@DarianLStephens
Copy link

DarianLStephens commented Oct 31, 2017

If I'm understanding this correctly, this mod would allow us to remove, add, or replace arbitrary sections of code in classes, without having to compile anything in java? (I've had zero luck setting up a forge dev environment, so this would be a great alternative for modifying existing classes)
If so, I'm going to go through the Minecraft bug reports and trying to apply some of those fixes!
The problem here is that there doesn't seem to be any documentation on this whatsoever; the best place to get it appears to be the source. Just a list of the possible function names (insertBeforeCode, whatever else there may be...) would be a great help to getting this going. As it stands, it looks like I need to either guess the functions or find them in the source, and I don't know how long the latter would take.

@LunNova
Copy link
Member

LunNova commented Oct 31, 2017

The methods available for xml patches are here:

https://github.com/nallar/JavaPatcher/blob/master/src/main/java/me/nallar/javapatcher/patcher/Patches.java

There's some javadoc there.

I'm not working on the XML patching system, for future development mixin patches will be preferred. So I won't be updating/improving documentation for it. Mixin patches wouldn't help you as they need a working dev environment.

Forge's dev environment shouldn't be too hard to get working. Install JDK 8. Set JAVA_HOME environment variable to JDK 8 path. Clone forge. .gradlew setupForge. Done.

@DarianLStephens
Copy link
Author

As long as the XML/JSON system works in 1.7.10 with the methods listed there, I'll be okay for now.
See, I've done that, but then when I try to open it in git it says it's not a valid git environment or something. I don't know, it's frustrating.

@DarianLStephens
Copy link
Author

Alright, so... I've been having trouble understanding just how to use it. I've been trying to remove the limit on mushroom spreading, but I haven't been able to figure out how to target the right section of code. I have tried many variations, but it usually says something to the effect of 'No method found in BlockMushroom.class'.
I believe the simplest way to do so would be to replace 'int l = 5;' with 'int l = 50;' or some equally high number, so it never reaches zero, but I'm not sure, because the source is mostly a lot of numbers and letters.
Do you suppose I could have a few working examples of removing a section of code, inserting a section of code after a specific section, and possibly replacing a section, if that's much different from just removing a bit and adding another after the line just before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants