Interface MinecraftDependencyWithAccessTransformers
- All Superinterfaces:
MinecraftDependency,MinecraftMappingsContainer
- All Known Subinterfaces:
ClosureOwner.MinecraftDependencyWithAccessTransformers
MinecraftDependency that contains additional convenience methods for working with
AccessTransformers.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default path, from the source set's resources, for the AccessTransformers config to be located in. -
Method Summary
Modifier and TypeMethodDescriptionorg.gradle.api.file.RegularFilePropertyGets the AccessTransformer configuration to use.voidsetAccessTransformer(boolean accessTransformer) Sets if this dependency should use AccessTransformers.voidsetAccessTransformer(String accessTransformer) Sets the path, relative to this dependency'sSourceSet.getResources(), to the AccessTransformers config file to use.Methods inherited from interface net.minecraftforge.gradle.MinecraftMappingsContainer
getMappings, mappings, mappings
-
Field Details
-
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
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 ofSourceDirectorySet.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 ofsrc/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 callssetAccessTransformer(String)usingDEFAULT_PATHas the path. Iffalse, 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:
-