Interface MinecraftDependencyWithAccessTransformers

All Superinterfaces:
MinecraftDependency, MinecraftMappingsContainer
All Known Subinterfaces:
ClosureOwner.MinecraftDependencyWithAccessTransformers

public interface MinecraftDependencyWithAccessTransformers extends MinecraftDependency
An extension of MinecraftDependency that contains additional convenience methods for working with AccessTransformers.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The default path, from the source set's resources, for the AccessTransformers config to be located in.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.gradle.api.file.RegularFileProperty
    Gets the AccessTransformer configuration to use.
    void
    setAccessTransformer(boolean accessTransformer)
    Sets if this dependency should use AccessTransformers.
    void
    setAccessTransformer(String accessTransformer)
    Sets the path, relative to this dependency's SourceSet.getResources(), to the AccessTransformers config file to use.

    Methods inherited from interface net.minecraftforge.gradle.MinecraftMappingsContainer

    getMappings, mappings, mappings
  • Field Details

    • DEFAULT_PATH

      static final String DEFAULT_PATH
      The default path, from the source set's resources, for the AccessTransformers config to be located in.
      See Also:
  • Method Details

    • getAccessTransformer

      org.gradle.api.file.RegularFileProperty getAccessTransformer()
      Gets the AccessTransformer configuration to use.
      Returns:
      The property for the configuration file to use
    • setAccessTransformer

      void setAccessTransformer(String accessTransformer)

      Sets the path, relative to this dependency's SourceSet.getResources(), to the AccessTransformers config file to use.

      The default location for the AccessTransformer config file will be in SourceSet.getResources() -> first directory of SourceDirectorySet.getSrcDirs() -> META-INF/accesstransformer.cfg. If the source set, for whatever reason, does not have any resources directories set, ForgeGradle will make the best guess of src/name /resources/META-INF/accesstransformer.cfg.

      Parameters:
      accessTransformer - The path to the config file to use
      API Note:
      Using getAccessTransformer() -> FileSystemLocationProperty.set(java.io.File) is strongly recommended if your config file is in a strict location.
    • setAccessTransformer

      void setAccessTransformer(boolean accessTransformer)

      Sets if this dependency should use AccessTransformers. The default value depends on the state of MinecraftExtensionForProjectWithAccessTransformers.getAccessTransformers().

      If true, this calls setAccessTransformer(String) using DEFAULT_PATH as the path. If false, this will force this dependency to not use AccessTransformers, even if the convention is set to do so from the Minecraft extension. This can be used to opt-out of AccessTransformer for a single Minecraft dependency if it is enabled globally for the rest of them in a project.

      Parameters:
      accessTransformer - If this dependency should use AccessTransformers
      See Also: