User Tools

Site Tools


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
Last revisionBoth sides next revision
documentation:fabric_loom [2023/02/04 23:25] – Show how to remove a built-in run configuration caoimhedocumentation:fabric_loom [2023/07/05 10:34] modmuss50
Line 11: Line 11:
   * ''genEclipseRuns'': Installs Eclipse run configurations and creates the run directory if it does not already exist.   * ''genEclipseRuns'': Installs Eclipse run configurations and creates the run directory if it does not already exist.
   * ''vscode'': Generates or overwrites a Visual Studio Code ''launch.json'' file with launch configurations in the ''.vscode'' directory and creates the run directory if it does not already exist.   * ''vscode'': Generates or overwrites a Visual Studio Code ''launch.json'' file with launch configurations in the ''.vscode'' directory and creates the run directory if it does not already exist.
 +  * ''ideaSyncTask'': Generates (but not overrides) the Intellij IDEA launch config, including client and server by default.
   * ''remapSourcesJar'': Only exists if an AbstractArchiveTask ''sourcesJar'' exists. Remaps the output of the ''sourcesJar'' task in place.   * ''remapSourcesJar'': Only exists if an AbstractArchiveTask ''sourcesJar'' exists. Remaps the output of the ''sourcesJar'' task in place.
   * ''runClient'': A JavaExec task to launch Fabric Loader as a Minecraft client.   * ''runClient'': A JavaExec task to launch Fabric Loader as a Minecraft client.
Line 22: Line 23:
 dependencies { dependencies {
  implementation project(path: ":name", configuration: "namedElements")  implementation project(path: ":name", configuration: "namedElements")
 +}
 +</code>
 +
 +If you are using splitsource sets in a multi-project build, you will also need to add a dependency for the other projects client sourceset.
 +
 +<code>
 +dependencies {
 + clientImplementation project(":name").sourceSets.client.output
 } }
 </code> </code>
Line 30: Line 39:
  
 The following snippet from a build.gradle file shows how you can enable this for your mod. As your mod will now be split across two sourcesets, you will need to use the new DSL to define your mods sourcesets. This enables Fabric Loader to group your mods classpath together. This is also useful for some other complex multi-project setups. The following snippet from a build.gradle file shows how you can enable this for your mod. As your mod will now be split across two sourcesets, you will need to use the new DSL to define your mods sourcesets. This enables Fabric Loader to group your mods classpath together. This is also useful for some other complex multi-project setups.
 +
 +Minecraft 1.18 (1.19 recommended), Loader 0.14 and Loom 1.0 or later are required to split the client and common code.
  
 <code> <code>
Line 44: Line 55:
 </code> </code>
  
-==== Mutli project Optimisation ====+==== Multi project Optimisation ====
  
-If your Gradle project has many subprojects that use the same Minecraft version such as Fabric-API, starting with Loom 1.1 you can now opt-in to advanced optimistations. Adding <code>fabric.loom.multiProjectOptimisation=true</code> to the settings.gradle file will help decrease build time and memory usage by sharing the Tiny Remapper instance between projects when remapping your output jars.+If your Gradle project has many subprojects that use the same Minecraft version such as Fabric-API, starting with Loom 1.1 you can now opt-in to advanced optimistations. Adding <code>fabric.loom.multiProjectOptimisation=true</code> to the gradle.properties file will help decrease build time and memory usage by sharing the Tiny Remapper instance between projects when remapping your output jars.
  
 ==== Options ==== ==== Options ====
Line 237: Line 248:
 ==== Resolving issues ==== ==== Resolving issues ====
  
-Loom and/or gradle can sometimes fail due to corrupted cache files. Running ''./gradlew build --refresh-dependencies'' will force gradle and loom to re-download and recreate all of the files. This may take a few minutes but is usually quite successful with resolving cache related issues.+Loom and/or gradle can sometimes fail due to corrupted cache files. Running ''./gradlew build <nowiki>--</nowiki>refresh-dependencies'' will force gradle and loom to re-download and recreate all of the files. This may take a few minutes but is usually quite successful with resolving cache related issues.
  
 ==== Development environment setup ==== ==== Development environment setup ====
documentation/fabric_loom.txt · Last modified: 2023/12/22 14:39 by modmuss50