User Tools

Site Tools


tutorial:primer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:primer [2022/12/22 16:44] – transform bullet points in "prerequisites" section into actual bullets basil4088tutorial:primer [2023/03/03 18:08] (current) – [What is Fabric?] miir
Line 27: Line 27:
   * the **Fabric Installer**-- a tool that installs the Fabric Loader on an end user's Minecraft installation.   * the **Fabric Installer**-- a tool that installs the Fabric Loader on an end user's Minecraft installation.
  
-To more easily understand what is going on in Minecraft's code, when you mod with Fabric, you will also have access to Minecraft's source code. Since Java is a compiled language, we need to decompile the code before it can be read. This turns it from Java bytecode into human-readable Java source code. However, to stop piracy, Mojang distributes Minecraft in **obfuscated** format. This means that all the classes, methods, and fields in the code have randomized names. You can see this for yourself by opening a Minecraft .jar file in a zip extractor tool-- all the files have names like ''abc.class''. And what's worse, there's no guarantee that an object will have the same name between two versions-- it could be called ''abc'' in one version, and ''abd'' in the next. This would make modding really, really hard, because without names, it's hard to tell what different variables do. To fix this, Fabric uses a set of **mapping** tools to give everything a human-readable name.((Note: While Mojang does publish official mappings for all Minecraft versions, the legality of using these mappings in mods could change in the future. Yarn mappings are libre for everyone to use and sufficient for most modding purposes, so you are discouraged from utilizing the official mappings.))+To more easily understand what is going on in Minecraft's code, when you mod with Fabric, you will also have access to Minecraft's source code. Since Java is a compiled language, we need to decompile the code before it can be read. This turns it from Java bytecode into human-readable Java source code. However, to stop reverse engineering, Mojang distributes Minecraft in **obfuscated** format. This means that all the classes, methods, and fields in the code have randomized names. You can see this for yourself by opening a Minecraft .jar file in a zip extractor tool-- all the files have names like ''abc.class''. And what's worse, there's no guarantee that an object will have the same name between two versions-- it could be called ''abc'' in one version, and ''abd'' in the next. This would make modding really, really hard, because without names, it's hard to tell what different variables do. To fix this, Fabric uses a set of **mapping** tools to give everything a human-readable name.((Note: While Mojang does publish official mappings for all Minecraft versions, the legality of using these mappings in mods could change in the future. Yarn mappings are libre for everyone to use and sufficient for most modding purposes, so you are discouraged from utilizing the official mappings.))
  
   * the **intermediary** mapper is a program that gives every single object in Minecraft's code a name like "field_10832", or "method_12991()". Critically, this program always names each object the same thing. So a method that does not change between versions will always have the same intermediary name.    * the **intermediary** mapper is a program that gives every single object in Minecraft's code a name like "field_10832", or "method_12991()". Critically, this program always names each object the same thing. So a method that does not change between versions will always have the same intermediary name. 
tutorial/primer.txt · Last modified: 2023/03/03 18:08 by miir