Class ForgeExtensionImpl
- All Implemented Interfaces:
ForgeExtensionAPI
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.fabricmc.loom.api.ForgeExtensionAPI
ForgeExtensionAPI.DataGenConsumer -
Constructor Summary
ConstructorsConstructorDescriptionForgeExtensionImpl(org.gradle.api.Project project, LoomGradleExtension extension) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccessTransformer(Object file) Adds a project access transformer.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.voiddataGen(org.gradle.api.Action<ForgeExtensionAPI.DataGenConsumer> action) Applies data generation settings.org.gradle.api.file.ConfigurableFileCollectionA collection of all project access transformers.org.gradle.api.provider.Property<Boolean> If true, the project access widener file will be remapped to an access transformer file if set.A list of mod IDs for mods applied for data generation.org.gradle.api.provider.SetProperty<String> A set of additional access widener files that will be converted to access transformers if enabled.org.gradle.api.provider.SetProperty<String> A set of all mixin configs related to source set resource roots.org.gradle.api.provider.Property<Pack200Provider> pack200 解包器,仅供 legacy Forge(1.8-1.16)使用.org.gradle.api.provider.Property<Boolean> If true, upstream Mixin from Sponge will be replaced with Fabric's or Architectury's fork.org.gradle.api.provider.Property<Boolean> If true, Loom will use Forge's Log4J config file instead of its own.voidmixinConfigs(String... mixinConfigs) Adds mixin config files tomixinConfigs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.fabricmc.loom.api.ForgeExtensionAPI
convertAccessWideners, mixinConfig
-
Constructor Details
-
ForgeExtensionImpl
-
-
Method Details
-
getConvertAccessWideners
Description copied from interface:ForgeExtensionAPIIf true, the project access widener file will be remapped to an access transformer file if set.Note that
ForgeExtensionAPI.convertAccessWideners(TaskProvider, String...)can be used instead of this method for more fine-grained control over which jar task converts the access wideners. This method targets theremapJartask on obfuscated versions and thejartask on unobfuscated versions.- Specified by:
getConvertAccessWidenersin interfaceForgeExtensionAPI- Returns:
- the property
-
getExtraAccessWideners
Description copied from interface:ForgeExtensionAPIA set of additional access widener files that will be converted to access transformers if enabled. The files are specified as paths in jar files (e.g.path/to/my_aw.accesswidener).Note that
ForgeExtensionAPI.convertAccessWideners(TaskProvider, String...)can be used instead of this method for more fine-grained control over which jar task converts the access wideners. This method targets theremapJartask on obfuscated versions and thejartask on unobfuscated versions.- Specified by:
getExtraAccessWidenersin interfaceForgeExtensionAPI- Returns:
- the property
-
getAccessTransformers
public org.gradle.api.file.ConfigurableFileCollection getAccessTransformers()Description copied from interface:ForgeExtensionAPIA 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).- Specified by:
getAccessTransformersin interfaceForgeExtensionAPI- Returns:
- the collection of AT files
-
accessTransformer
Description copied from interface:ForgeExtensionAPIAdds a project access transformer.- Specified by:
accessTransformerin interfaceForgeExtensionAPI- Parameters:
file- the file, evaluated as perProject.file(Object)
-
convertAccessWideners
public void convertAccessWideners(org.gradle.api.tasks.TaskProvider<? extends org.gradle.jvm.tasks.Jar> jarTask, org.gradle.api.Action<? super Aw2AtSettings> action) Description copied from interface:ForgeExtensionAPISets 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.- Specified by:
convertAccessWidenersin interfaceForgeExtensionAPI
-
getMixinConfigs
Description copied from interface:ForgeExtensionAPIA set of all mixin configs related to source set resource roots. All mixin configs must be added to this property so that they apply in a dev environment.- Specified by:
getMixinConfigsin interfaceForgeExtensionAPI- Returns:
- the property
-
mixinConfigs
Description copied from interface:ForgeExtensionAPIAdds mixin config files tomixinConfigs.- Specified by:
mixinConfigsin interfaceForgeExtensionAPI- Parameters:
mixinConfigs- the mixin config file paths relative to resource roots
-
getUseCustomMixin
Description copied from interface:ForgeExtensionAPIIf true, upstream Mixin from Sponge will be replaced with Fabric's or Architectury's fork. This is enabled by default.- Specified by:
getUseCustomMixinin interfaceForgeExtensionAPI- Returns:
- the property
-
getUseForgeLoggerConfig
Description copied from interface:ForgeExtensionAPIIf true, Loom will use Forge's Log4J config file instead of its own. This is disabled by default.- Specified by:
getUseForgeLoggerConfigin interfaceForgeExtensionAPI- Returns:
- the property
-
getDataGenMods
Description copied from interface:ForgeExtensionAPIA list of mod IDs for mods applied for data generation. The returned list is unmodifiable but not immutable - it will reflect changes done withForgeExtensionAPI.dataGen(Action).- Specified by:
getDataGenModsin interfaceForgeExtensionAPI- Returns:
- the list
-
dataGen
Description copied from interface:ForgeExtensionAPIApplies data generation settings.- Specified by:
dataGenin interfaceForgeExtensionAPI- Parameters:
action- the action to configure data generation
-
getPack200Provider
Description copied from interface:ForgeExtensionAPIpack200 解包器,仅供 legacy Forge(1.8-1.16)使用.legacy 的 binpatches 以 pack200 压缩,而 JDK 自 14 起不再自带解包实现, 需要调用方注入(例如 architectury-pack200)。
- Specified by:
getPack200Providerin interfaceForgeExtensionAPI
-