diff --git a/src/main/java/net/fabricmc/loom/api/ForgeExtensionAPI.java b/src/main/java/net/fabricmc/loom/api/ForgeExtensionAPI.java index 6f1dfa6d..58339b87 100644 --- a/src/main/java/net/fabricmc/loom/api/ForgeExtensionAPI.java +++ b/src/main/java/net/fabricmc/loom/api/ForgeExtensionAPI.java @@ -110,7 +110,7 @@ public interface ForgeExtensionAPI { * {@link #dataGen(Action)}. * * @return the list - * @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}. + * @deprecated Removed in favor of configuring the data generator directly. */ @ApiStatus.ScheduledForRemoval(inVersion = "2.0") @Deprecated(forRemoval = true) @@ -120,7 +120,7 @@ public interface ForgeExtensionAPI { * Applies data generation settings. * * @param action the action to configure data generation - * @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}. + * @deprecated Removed in favor of configuring the data generator directly. */ @ApiStatus.ScheduledForRemoval(inVersion = "2.0") @Deprecated(forRemoval = true) @@ -128,7 +128,7 @@ public interface ForgeExtensionAPI { /** * Data generation config. - * @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}. + * @deprecated Removed in favor of configuring the data generator directly. */ @ApiStatus.NonExtendable @ApiStatus.ScheduledForRemoval(inVersion = "2.0") diff --git a/src/main/java/net/fabricmc/loom/configuration/ide/RunConfigSettings.java b/src/main/java/net/fabricmc/loom/configuration/ide/RunConfigSettings.java index 821011eb..c9c32e2f 100644 --- a/src/main/java/net/fabricmc/loom/configuration/ide/RunConfigSettings.java +++ b/src/main/java/net/fabricmc/loom/configuration/ide/RunConfigSettings.java @@ -328,23 +328,12 @@ public final class RunConfigSettings implements Named { /** * Configure run config with the default data options. * - * @deprecated Use {@link #environment}("server") and {@link #forgeTemplate}("data") instead and - * configure the data generator manually. Deprecated for removal for two reasons: - *
    - *
  1. This method is only needed on Forge. Fabric setups should use {@link #server}. - *
  2. It's inflexible and hardcodes the output path as well as validation. - *
+ *

This method can only be used on Forge. */ - @ApiStatus.ScheduledForRemoval(inVersion = "2.0") - @Deprecated(forRemoval = true) public void data() { - extension.getDeprecationHelper().warn("RunConfigSettings.data() has been deprecated and replaced with forgeTemplate(\"data\"). This will be removed in Loom 2.0."); + ModPlatform.assertPlatform(getExtension(), ModPlatform.FORGE, () -> "RunConfigSettings.data() is only usable on Forge."); environment("data"); - defaultMainClass(Constants.Knot.KNOT_SERVER); - - if (getExtension().isForge()) { - forgeTemplate("data"); - } + forgeTemplate("data"); } /** diff --git a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java index 29e94f28..756da0c6 100644 --- a/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java +++ b/src/main/java/net/fabricmc/loom/task/launch/GenerateDLIConfigTask.java @@ -112,14 +112,20 @@ public abstract class GenerateDLIConfigTask extends AbstractLoomTask { .property("fabric.yarnWithSrg.path", getExtension().getMappingConfiguration().tinyMappingsWithSrg.toAbsolutePath().toString()) .property("unprotect.mappings", unprotectMappings) - .argument("data", "--all") - .argument("data", "--mod") - .argument("data", String.join(",", getExtension().getForge().getDataGenMods())) - .argument("data", "--output") - .argument("data", getProject().file("src/generated/resources").getAbsolutePath()) - .property("mixin.env.remapRefMap", "true"); + final List dataGenMods = getExtension().getForge().getDataGenMods(); + + // Only apply the hardcoded data arguments if the deprecated data generator API is being used. + if (!dataGenMods.isEmpty()) { + launchConfig + .argument("data", "--all") + .argument("data", "--mod") + .argument("data", String.join(",", getExtension().getForge().getDataGenMods())) + .argument("data", "--output") + .argument("data", getProject().file("src/generated/resources").getAbsolutePath()); + } + if (PropertyUtil.getAndFinalize(getExtension().getForge().getUseCustomMixin())) { launchConfig.property("mixin.forgeloom.inject.mappings.srg-named", getExtension().getMappingConfiguration().getReplacedTarget(getExtension(), "srg").toAbsolutePath().toString()); } else {