User Tools

Site Tools


tutorial:reading_mc_code

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:reading_mc_code [2022/09/17 06:46] – search translation keys siglongtutorial:reading_mc_code [2023/11/17 19:02] cph101
Line 6: Line 6:
 To read the Minecraft source, you need to generate sources first. See the "Generating Minecraft Sources" section in [[tutorial:setup|Setting up a mod development environment]]. To read the Minecraft source, you need to generate sources first. See the "Generating Minecraft Sources" section in [[tutorial:setup|Setting up a mod development environment]].
  
-===== Searching for a Minecraft class ====+===== Searching for a Minecraft class =====
 To search a Minecraft class, follow these steps. To search a Minecraft class, follow these steps.
  
-==== Intellij IDEA ==== +===== Intellij IDEA ===== 
-    - Open the search pane with ''Ctrl + N''+    - Open the search pane with {{https://i.ibb.co/rmztpCy/IMG-0712.png?height=64}} or {{https://i.ibb.co/2SDypGK/kbs-meta-o.png?height=80}} on mac
     - Set the search scope to ''Project and Libraries'' or wider     - Set the search scope to ''Project and Libraries'' or wider
     - Type the class name in the search box     - Type the class name in the search box
  
-==== Visual Studio Code ====+===== Visual Studio Code =====
     - Open the search pane with ''Ctrl + P''     - Open the search pane with ''Ctrl + P''
     - Type the class name with prefix ''#''     - Type the class name with prefix ''#''
 +
 +===== Eclipse =====
 +    - Open the search pane with ''Ctrl + Shift + R''
  
 In Visual Studio Code, you can also use ''Ctrl + T'' to open the class search directly. In Visual Studio Code, you can also use ''Ctrl + T'' to open the class search directly.
Line 25: Line 28:
     * Take full advantage of IDE's ability to find the relevant code such as ''Call hierarchy'', ''Method hierarchy'' or ''Type hierarchy''.     * Take full advantage of IDE's ability to find the relevant code such as ''Call hierarchy'', ''Method hierarchy'' or ''Type hierarchy''.
     * Take a look at open source mods which are similar to what you want to make.     * Take a look at open source mods which are similar to what you want to make.
-    * If you are adding a new content, there is a good chance you need to access registries defined in ''net.minecraft.util.registry.Registry''.+    * If you are adding a new content, there is a good chance you need to access registries defined in ''net.minecraft.util.registry.Registries''.
     * Keep in mind that everything starts from one main class (''net.minecraft.client.main.Main'' for client, ''net.minecraft.server.Main'' for dedicated server).     * Keep in mind that everything starts from one main class (''net.minecraft.client.main.Main'' for client, ''net.minecraft.server.Main'' for dedicated server).
-    * Search translation keys in Minecraft code. ''assets/assets/minecraft/lang/en_us.json'' contains all keys used in vanilla.+    * Search Minecraft code for translation keys. ''assets/assets/minecraft/lang/en_us.json'' contains all keys used in vanilla.
  
 ===== Reading the bytecode ===== ===== Reading the bytecode =====
tutorial/reading_mc_code.txt · Last modified: 2023/11/17 19:14 by cph101