User Tools

Site Tools


zh_cn: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
zh_cn:tutorial:reading_mc_code [2022/09/29 05:22] solidblockzh_cn:tutorial:reading_mc_code [2023/08/29 10:28] (current) – [查找你想要看到的类] solidblock
Line 10: Line 10:
  
 ==== Intellij IDEA ==== ==== Intellij IDEA ====
-    - 按 ''Ctrl + N'' 打开搜索面板+    - 按 {{https://i.ibb.co/rmztpCy/IMG-0712.png?height=64}} 或 mac 上的 {{https://i.ibb.co/2SDypGK/kbs-meta-o.png?height=80}} 打开搜索面板
     - 将搜索范围设为 ''项目和库'' 或者更大范围     - 将搜索范围设为 ''项目和库'' 或者更大范围
     - 在搜索框中输入类名称     - 在搜索框中输入类名称
Line 21: Line 21:
  
 ===== 查找你想要看到的类 ==== ===== 查找你想要看到的类 ====
-Locating the part of code you want to see is a challenging task. Here are some tips. +定位到你需要岔开的代码部分并不容易。这里是一些小技巧:
- +
-    * 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. +
-    * If you are adding a new content, there is a good chance you need to access registries defined in ''net.minecraft.util.registry.Registry''+
-    * 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 Minecraft code for translation keys. ''assets/assets/minecraft/lang/en_us.json'' contains all keys used in vanilla.+
  
 +    * 充分利用 IDE 的查找相关代码的能力,如调用递归、方法递归、类型递归等。
 +    * 看看与你需要制作的模组类似地开源模组是怎么做的。
 +    * 如果你需要添加新内容,可以访问在 ''net.minecraft.util.registry.Registries'' 中定义的注册表。
 +    * 记住一切都是从主类(客户端 ''net.minecraft.client.main.Main'',专用服务器 ''net.minecraft.server.Main'')开始的。
 +    * 在 Minecraft 代码中查找翻译键。''assets/assets/minecraft/lang/en_us.json'' 包含了原版使用的所有翻译键。
 ===== 阅读字节码 ===== ===== 阅读字节码 =====
 有时必须要阅读字节码,这是因为 有时必须要阅读字节码,这是因为
zh_cn/tutorial/reading_mc_code.1664428940.txt.gz · Last modified: 2022/09/29 05:22 by solidblock