zh_cn:tutorial:reading_mc_code
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| zh_cn:tutorial:reading_mc_code [2022/09/29 05:22] – solidblock | zh_cn:tutorial:reading_mc_code [2025/12/13 15:27] (current) – peqb | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== 阅读 Minecraft 源代码 ====== | ====== 阅读 Minecraft 源代码 ====== | ||
| - | 阅读 Minecraft 源代码时编写模组时的重要技巧,这是因为: | + | 阅读 Minecraft 源代码是编写模组时的重要技巧,这是因为: |
| * Minecraft 的很多东西都没有文档 | * Minecraft 的很多东西都没有文档 | ||
| * 文档和教程很容易过时 | * 文档和教程很容易过时 | ||
| Line 10: | Line 10: | ||
| ==== Intellij IDEA ==== | ==== Intellij IDEA ==== | ||
| - | - 按 '' | + | - 按 {{https:// |
| - 将搜索范围设为 '' | - 将搜索范围设为 '' | ||
| - 在搜索框中输入类名称 | - 在搜索框中输入类名称 | ||
| 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 '' | + | |
| - | * 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 '' | + | |
| - | * Keep in mind that everything starts from one main class ('' | + | |
| - | * Search Minecraft code for translation keys. '' | + | |
| + | * 充分利用 IDE 的查找相关代码的能力,如调用递归、方法递归、类型递归等。 | ||
| + | * 看看与你需要制作的模组类似的开源模组是怎么做的。 | ||
| + | * 如果你需要添加新内容,可以访问在 '' | ||
| + | * 记住一切都是从主类(客户端 '' | ||
| + | * 在 Minecraft 代码中查找翻译键。'' | ||
| ===== 阅读字节码 ===== | ===== 阅读字节码 ===== | ||
| 有时必须要阅读字节码,这是因为 | 有时必须要阅读字节码,这是因为 | ||
zh_cn/tutorial/reading_mc_code.1664428940.txt.gz · Last modified: 2022/09/29 05:22 by solidblock