Interface MinecraftDependencyWithAccessTransformers

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

public sealed interface MinecraftDependencyWithAccessTransformers extends MinecraftDependency permits ClosureOwner.MinecraftDependencyWithAccessTransformers (not exhaustive)
An extension of MinecraftDependency that contains additional convenience methods for working with AccessTransformers.
See Also:
  • 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

      RegularFileProperty getAccessTransformer()
      Gets the AccessTransformer configuration to use.
      Returns:
      The property for the configuration file to use
      API Note:
      To change other options with AccessTransformers, use accessTransformer(Action)
    • 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:
    • accessTransformer

      void accessTransformer(Action<? super net.minecraftforge.accesstransformers.gradle.AccessTransformersContainer.Options> options)
      Configures the AccessTransformer options for this project.
      Parameters:
      options - The options to apply