User Tools

Site Tools


zh_cn:tutorial:mappings

Differences

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

Link to this comparison view

Next revisionBoth sides next revision
zh_cn:tutorial:mappings [2019/12/18 11:23] – created lightcolourzh_cn:tutorial:mappings [2019/12/18 11:25] lightcolour
Line 1: Line 1:
-====== Mappings ======+====== 映射 ======
  
-==== Introduction ====+==== 介绍 ====
  
-Mappings define the names of classes, fields and methods. In an ordinary loom environment, [[https://github.com/FabricMC/yarn|Yarn]] mappings are used, which provide meaningful names for the Minecraft codebase as decided by the community. [[https://github.com/FabricMC/intermediary|Intermediary]] is also an essential type of mapping used by Fabric. The need for mappings comes from the obfuscation of Minecraft releases, which presents multiple challenges. Remapping is the process of applying mappings to compiled classes or source files.+映射定义类,字段和方法的名称。 在普通的织机环境中,使用[[https://github.com/FabricMC/yarn|Yarn]]映射,该映射为社区确定的Minecraft代码库提供了有意义的名称。 [[https://github.com/FabricMC/intermediary|Intermediary]]也是Fabric使用的基本映射类型。 对映射的需求来自对Minecraft版本的混淆,这带来了许多挑战。 重新映射是将映射应用于已编译的类或源文件的过程。
  
-==== Using mappings ====+==== 使用映射 ====
  
-In Loom, the mappings define the names for Minecraft classes, fields and methods used in your development environment. These names may vary from one development environment to another depending on the installed mappings.+Loom中,映射定义了开发环境中使用的Minecraft类,字段和方法的名称。 根据安装的映射,这些名称可能因开发环境而异。
  
-Yarn is the default mapping used by Loom. Yarn gradually improves and receives new releases as contributions are accepted. Mappings in Loom are specified using the ''mappings'' dependency configuration in the buildscript and can be updated by updating the dependency. Minecraft as well as dependencies included with mod-augmented dependency configurations like ''modCompile'' are remapped with the mapping. Classes, fields and methods that are not mapped in Yarn are given Intermediary names like ''class_1234''''method_1234'' and ''field_1234''.+毛线是Loom使用的默认映射。 随着贡献的增加,纱线会逐渐改进并获得新的版本。 使用构建脚本中的“映射”依赖项配置来指定Loom中的映射,并且可以通过更新依赖项来进行更新。 Minecraft以及mod增强的依赖项配置(例如 ''modCompile'' )中包含的依赖项均通过映射进行映射。 未在Yarn中映射的类,字段和方法的中间名称为''class_1234''''method_1234''''field_1234''
  
 <code> <code>
Line 18: Line 18:
 </code> </code>
  
-By changing the mappings in your development environment, you can expect that names of classes, methods and fields in Minecraft and any included mods have changed, and that your code might have to be updated to reference the changed names. [[tutorial:migratemappings|This process can be partially automated]]. You will also have to run ''genSources'' to access Minecraft sources with the updated mappings.+通过更改开发环境中的映射,可以预期Minecraft中的类,方法和字段的名称以及所有包含的mod均已更改,并且可能必须更新代码以引用更改后的名称。 [[tutorial:migratemappings|此过程可以部分自动化]]。 您还必须运行''genSources''以使用更新的映射访问Minecraft源。
  
 Loom's ''remapJar'' task will produce the primary mod artifact, which is a built jar using intermediary names. Additionally, if a ''sourcesJar'' task is present, ''remapSourcesJar'' will produce a sources jar using intermediary names. These jars can be installed as mods or included in a development environment with the ''modCompile'' dependency configuration. Loom's ''remapJar'' task will produce the primary mod artifact, which is a built jar using intermediary names. Additionally, if a ''sourcesJar'' task is present, ''remapSourcesJar'' will produce a sources jar using intermediary names. These jars can be installed as mods or included in a development environment with the ''modCompile'' dependency configuration.
zh_cn/tutorial/mappings.txt · Last modified: 2024/04/15 00:57 by solidblock