Deprecate RunConfigSettings.data()

This commit is contained in:
Juuz
2023-01-07 02:22:59 +02:00
parent f2c0d7a35d
commit cab269435e
2 changed files with 20 additions and 1 deletions

View File

@@ -110,20 +110,29 @@ public interface ForgeExtensionAPI {
* {@link #dataGen(Action)}.
*
* @return the list
* @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}.
*/
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
@Deprecated(forRemoval = true)
List<String> getDataGenMods();
/**
* Applies data generation settings.
*
* @param action the action to configure data generation
* @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}.
*/
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
@Deprecated(forRemoval = true)
void dataGen(Action<DataGenConsumer> action);
/**
* Data generation config.
* @deprecated See {@link net.fabricmc.loom.configuration.ide.RunConfigSettings#data}.
*/
@ApiStatus.NonExtendable
@ApiStatus.ScheduledForRemoval(inVersion = "2.0")
@Deprecated(forRemoval = true)
interface DataGenConsumer {
/**
* Adds mod IDs applied for data generation.

View File

@@ -326,9 +326,19 @@ public final class RunConfigSettings implements Named {
}
/**
* Configure run config with the default server options.
* Configure run config with the default data options.
*
* @deprecated Use <code>{@link #environment}("server")</code> and <code>{@link #forgeTemplate}("data")</code> instead and
* configure the data generator manually. Deprecated for removal for two reasons:
* <ol>
* <li>This method is only needed on Forge. Fabric setups should use {@link #server}.
* <li>It's inflexible and hardcodes the output path as well as validation.
* </ol>
*/
@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.");
environment("data");
defaultMainClass(Constants.Knot.KNOT_SERVER);