User Tools

Site Tools


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/17 04:46] solidblockzh_cn:documentation:fabric_loom [2023/10/10 15:33] (current) – Sync rawdiamondmc
Line 11: Line 11:
   * ''genEclipseRuns'':安装 Eclipse 运行配置并创建运行目录(如果还不存在)。   * ''genEclipseRuns'':安装 Eclipse 运行配置并创建运行目录(如果还不存在)。
   * ''vscode'':生成或覆盖 Visual Studio Code 的 ''launch.json'' 文件,启动配置在 ''.vscode'' 文件夹中,并创建运行目录,如果还不存在。   * ''vscode'':生成或覆盖 Visual Studio Code 的 ''launch.json'' 文件,启动配置在 ''.vscode'' 文件夹中,并创建运行目录,如果还不存在。
 +  * ''ideaSyncTask'':生成(但是不会覆盖)Intellij IDEA 的启动配置,包括客户端和服务器。
   * ''remapSourcesJar'':只有在 AbstractArchiveTask ''sourcesJar'' 存在时存在。将 ''sourcesJar'' 任务的输出重映射。   * ''remapSourcesJar'':只有在 AbstractArchiveTask ''sourcesJar'' 存在时存在。将 ''sourcesJar'' 任务的输出重映射。
   * ''runClient'':将 Fabric Loader 作为 Minecraft 客户端运行的 JavaExec 任务。   * ''runClient'':将 Fabric Loader 作为 Minecraft 客户端运行的 JavaExec 任务。
Line 21: 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 30: Line 39:
  
 以下 build.gradle 文件片段展示了如何为您的模组启用此功能。由于您的模组现在将拆分为两个源集,因此您将需要使用新的 DSL 来定义您的模组源集。这将会让 Fabric Loader 将您的模组类路径组合在一起,对于其他一些复杂的多项目设置也有用。 以下 build.gradle 文件片段展示了如何为您的模组启用此功能。由于您的模组现在将拆分为两个源集,因此您将需要使用新的 DSL 来定义您的模组源集。这将会让 Fabric Loader 将您的模组类路径组合在一起,对于其他一些复杂的多项目设置也有用。
 +
 +要分享客户端与服务器的代码,需要 Minecraft 1.18(建议 1.19)、Loader 0.14 和 Loom 1.0 以上的版本。
 <code> <code>
 loom { loom {
zh_cn/documentation/fabric_loom.1681706814.txt.gz · Last modified: 2023/04/17 04:46 by solidblock