Hexeption / MCP-Reborn

MCP-Reborn is an MCP (Mod Coder Pack) for Minecraft for making modded clients and researching its code. (1.13-1.20.1)
Other
1.03k stars 138 forks source link

Getting started #205

Open ghost opened 2 years ago

ghost commented 2 years ago

Good day to all, I wanted to start programming a client for fun, but I don't think it will be so easy. The names of the class are understandable, but e.g. attributes of functions are called like this: p133732

So now my question is how to work with such terms and labels. Can I somehow use the Forge API, MCP has been supported by the Forge team.

Does anyone have a tip for me how I can get into client programming as easily as possible, the given classes are unfortunately incomprehensible, an official reference book I think also does not exist.

Kind regards Nicklas

AbsoluteWisp commented 2 years ago

It is sadly not possible to recover parameter names, that's just the nature of how decompilable Java is. While class and method names are preserved, parameter names won't be available without a significant effort to manually name them again.

PiTheGuy commented 2 years ago

Go into your build.gradle and configure it to use parchment mappings. Parchment mappings are a community made set of mapping built on the official mappings. This includes most parameter names. It's not perfect, but it's a lot better than the official mappings. This doesn't support 1.19 yet though so you might have to wait for that if you want to do 1.19.

Melonthedev commented 2 years ago

From my experience I can say it's better to start with a 1.8 client because you'll find lots of tutorials and after that try to implement it into the newer versions because not much changed. For example the gui class was called "GuiScreen" in 1.8 and now it's just called "Screen" etc. You will find the similarities in methods etc. and if you dont know what parameters do, you will probably find some code on it in 1.8 and thats often really sililar to the newer parameters.

If you want you can look into this repo, I collected some things that can help you coding your client: MCP Tips

Hope this can help