mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 13:05:27 -05:00
Fix DLI not applying to multiword NeoForge envs like dataClient
Fixes #268. All the environments are now lowercase which should be fine. Additionally, reverts commits127345eaand07f91bfdsince the workaround is no longer needed and causes a crash.
This commit is contained in:
@@ -116,13 +116,6 @@ public record ForgeRunTemplate(
|
||||
settings.getEnvironmentVariables().putIfAbsent(key, resolved);
|
||||
});
|
||||
|
||||
// TODO: Also remove this hack once DLI supports clientData as the env
|
||||
if (this.name.equals("dataClient") || this.name.equals("dataServer")) {
|
||||
for (ConfigValue arg : args) {
|
||||
settings.programArg(arg.resolve(configValueResolver));
|
||||
}
|
||||
}
|
||||
|
||||
// Add MOD_CLASSES, this is something that ForgeGradle does
|
||||
settings.getEnvironmentVariables().computeIfAbsent("MOD_CLASSES", $ -> ConfigValue.of("{source_roots}").resolve(configValueResolver));
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
@@ -272,12 +273,16 @@ public abstract class GenerateDLIConfigTask extends AbstractLoomTask {
|
||||
}
|
||||
|
||||
for (ForgeRunTemplate.Resolved template : getRunTemplates().get()) {
|
||||
// Note: lowercase to match RunConfig which lowercases all user input for
|
||||
// RunConfigSettings.environment
|
||||
var env = template.name().toLowerCase(Locale.ROOT);
|
||||
|
||||
for (String argument : template.args()) {
|
||||
launchConfig.argument(template.name(), argument);
|
||||
launchConfig.argument(env, argument);
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> property : template.props().entrySet()) {
|
||||
launchConfig.property(template.name(), property.getKey(), property.getValue());
|
||||
launchConfig.property(env, property.getKey(), property.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user