Interface NeoForgeExtensionAPI
- All Known Implementing Classes:
NeoForgeExtensionImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccessTransformer(Object file) Adds a project access transformer.default voidconvertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, String... awPaths) Sets up AW → AT conversion for the provided jar task.voidconvertAccessWideners(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.ConfigurableFileCollectionA 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.cfgin themainsource set).- Returns:
- the collection of AT files
-
accessTransformer
Adds a project access transformer.- Parameters:
file- the file, evaluated as perProject.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
resourcesdirectories in a development environment, not the project directory! For example,"my_mod.accesswidener"corresponds to the source filesrc/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
remapJaror anotherRemapJarTaskin 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 correspondingatAccessWidenersproperty. -
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
resourcesdirectories in a development environment, not the project directory! For example,"my_mod.accesswidener"corresponds to the source filesrc/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
remapJaror anotherRemapJarTaskin 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 correspondingatAccessWidenersproperty.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
-