Interface NeoForgeExtensionAPI

All Known Implementing Classes:
NeoForgeExtensionImpl

public interface NeoForgeExtensionAPI
This is the NeoForge extension API available to build scripts.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    default void
    convertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, String... awPaths)
    Sets up AW → AT conversion for the provided jar task.
    void
    convertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.Action<? super Aw2AtSettings> action)
    Sets up AW → AT conversion for the provided jar task.
    org.gradle.api.file.ConfigurableFileCollection
    A collection of all project access transformers.
  • Method Details

    • getAccessTransformers

      org.gradle.api.file.ConfigurableFileCollection getAccessTransformers()
      A collection of all project access transformers. The collection should only contain AT files, and not directories or other files.

      If this collection is empty, Loom tries to resolve the AT from the default path (META-INF/accesstransformer.cfg in the main source set).

      Returns:
      the collection of AT files
    • accessTransformer

      void accessTransformer(Object file)
      Parameters:
      file - the file, evaluated as per Project.file(Object)
    • convertAccessWideners

      @Experimental void convertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.Action<? super Aw2AtSettings> action)
      Sets up AW → AT conversion for the provided jar task.

      The file paths are relative to the mod jar root, corresponding to resources directories in a development environment, not the project directory! For example, "my_mod.accesswidener" corresponds to the source file src/main/resources/my_mod.accesswidener.

      The specified files will be converted and removed from the final jar.

      In projects with an obfuscated version of Minecraft, this method must target remapJar or another RemapJarTask in order for the access transformer to be remapped properly.

      When the provided task is a RemapJarTask, the AW paths will simply be added to the corresponding atAccessWideners property.

    • convertAccessWideners

      @Experimental default void convertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, String... awPaths)
      Sets up AW → AT conversion for the provided jar task.

      The file paths are relative to the mod jar root, corresponding to resources directories in a development environment, not the project directory! For example, "my_mod.accesswidener" corresponds to the source file src/main/resources/my_mod.accesswidener.

      The specified files will be converted and removed from the final jar.

      In projects with an obfuscated version of Minecraft, this method must target remapJar or another RemapJarTask in order for the access transformer to be remapped properly.

      When the provided task is a RemapJarTask, the AW paths will simply be added to the corresponding atAccessWideners property.

      Usage example:

      loom.neoForge.convertAccessWideners(tasks.jar, "my_mod.accesswidener")
      
      Parameters:
      awPaths - the paths of the access wideners relative to the mod jar root, cannot be empty