zh_cn:documentation:fabric_loom

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:documentation:fabric_loom [2023/04/29 07:35] – [分离客户端与常规代码] solidblockzh_cn:documentation:fabric_loom [2024/08/17 11:07] (current) – Sync jeffreyg1228
Line 22: Line 22:
 <code> <code>
 dependencies { dependencies {
- implementation project(path: ":name", configuration: "namedElements")+    implementation project(path: ":name", configuration: "namedElements") 
 +
 +</code> 
 + 
 +如果你在多项目构建中使用分离源集,你还需要为其他项目客户端源集添加依赖项。 
 + 
 +<code> 
 +dependencies { 
 +    clientImplementation project(":name").sourceSets.client.output
 } }
 </code> </code>
Line 111: Line 119:
  source = sourceSets.test  source = sourceSets.test
  }  }
 +
 + // 删除内置服务器配置的示例
 +                remove server
  }  }
  
Line 160: Line 171:
  }  }
  }  }
 +
 + // 创建 modExampleImplementation 和重映射 mods 的相关配置。
 + createRemapConfigurations(sourceSets.example)
 } }
  
Line 245: Line 259:
   - 添加 Minecraft 的依赖。   - 添加 Minecraft 的依赖。
   - 下载 Minecraft 资源文件(assets)。   - 下载 Minecraft 资源文件(assets)。
-  - 处理并包含模组增强的依赖(还可以导出并重映射嵌套的 JAR)+  - 处理并包含模组增强的依赖。
  
 ==== 缓存 ==== ==== 缓存 ====
Line 257: Line 271:
   * ''minecraft'':定义用于开发环境的 Minecraft 版本。   * ''minecraft'':定义用于开发环境的 Minecraft 版本。
   * ''mappings'':定义用于开发环境的映射。   * ''mappings'':定义用于开发环境的映射。
-  * ''modCompile''、''modImplementation''、''modApi'' 和''modRuntime'':相当于''compile''、''implementation''、''api''和''runtime''的增强型变种,用于模组依赖。会被重映射以对应开发环境,并且会移除嵌套的 JAR。可以选择导出并重映射嵌套的 JAR。+  * ''modCompile''、''modImplementation''、''modApi'' 和''modRuntime'':相当于''compile''、''implementation''、''api''和''runtime''的增强型变种,用于模组依赖。会被重映射以对应开发环境,并且会移除嵌套的 JAR。
   * ''include'':生命一个应在 ''remapJar'' 输出中包含的 jar-in-jar 依赖。该依赖配置是不可传递的。对于非模组依赖,Loom 会生成一个模组 JAR,其中 fabric.mod.json 使用模组 ID 的名称和相同版本。   * ''include'':生命一个应在 ''remapJar'' 输出中包含的 jar-in-jar 依赖。该依赖配置是不可传递的。对于非模组依赖,Loom 会生成一个模组 JAR,其中 fabric.mod.json 使用模组 ID 的名称和相同版本。
  
zh_cn/documentation/fabric_loom.1682753720.txt.gz · Last modified: 2023/04/29 07:35 by solidblock