mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Include a very bad workaround for NeoForge 1.21.4, we will revert this once we fix DLI
DLI fails to parse the launch.cfg with clientDataArgs as keys when reading as client, since it would try to recognise what DataArgs is, when it is not even its entry. This is a temporary fix.
This commit is contained in:
@@ -403,6 +403,30 @@ public class RunConfigSettings implements Named {
|
||||
forgeTemplate("data");
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure run config with the default data options.
|
||||
*
|
||||
* <p>This method can only be used on NeoForge.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public void clientData() {
|
||||
ModPlatform.assertForgeLike(getExtension(), () -> "RunConfigSettings.clientData() is only usable on NeoForge.");
|
||||
environment("dataClient");
|
||||
forgeTemplate("dataClient");
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure run config with the default data options.
|
||||
*
|
||||
* <p>This method can only be used on NeoForge.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public void serverData() {
|
||||
ModPlatform.assertForgeLike(getExtension(), () -> "RunConfigSettings.serverData() is only usable on NeoForge.");
|
||||
environment("dataServer");
|
||||
forgeTemplate("dataServer");
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies a Forge run config template to these settings.
|
||||
*
|
||||
|
||||
@@ -66,7 +66,13 @@ public record ForgeRunTemplate(
|
||||
public static final Codec<Map<String, ForgeRunTemplate>> MAP_CODEC = Codec.unboundedMap(Codec.STRING, CODEC)
|
||||
.xmap(
|
||||
map -> {
|
||||
final Map<String, ForgeRunTemplate> newMap = new HashMap<>(map);
|
||||
final Map<String, ForgeRunTemplate> newMap = new HashMap<>();
|
||||
|
||||
// TODO: Remove this hack once we patch DLI to support clientData as env
|
||||
for (Map.Entry<String, ForgeRunTemplate> entry : map.entrySet()) {
|
||||
String name = entry.getKey().replaceAll("clientData", "dataClient").replaceAll("serverData", "dataServer");
|
||||
newMap.put(name, entry.getValue());
|
||||
}
|
||||
|
||||
// Iterate through all templates and fill in empty names.
|
||||
// The NeoForge format doesn't include the name property, so we'll use the map keys
|
||||
|
||||
Reference in New Issue
Block a user