mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
Replace Union Relauncher with Bootstrap Dev
This commit is contained in:
@@ -19,7 +19,6 @@ access-transformers-new = "8.0.5"
|
||||
access-transformers-neo = "10.0.2"
|
||||
unprotect = "1.2.0"
|
||||
asm = "9.7"
|
||||
union-relauncher = "1.1.1"
|
||||
access-transformers-log4j = "2.17.1"
|
||||
|
||||
[libraries]
|
||||
@@ -45,5 +44,4 @@ access-transformers-new = { module = "net.minecraftforge:accesstransformers", ve
|
||||
access-transformers-neo = { module = "net.neoforged.accesstransformers:at-cli", version.ref = "access-transformers-neo" }
|
||||
unprotect = { module = "io.github.juuxel:unprotect", version.ref = "unprotect" }
|
||||
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
|
||||
union-relauncher = { module = "io.github.juuxel:union-relauncher", version.ref = "union-relauncher" }
|
||||
access-transformers-log4j-bom = { module = "org.apache.logging.log4j:log4j-bom", version.ref = "access-transformers-log4j" }
|
||||
|
||||
@@ -96,6 +96,13 @@ public class ForgeLibrariesProvider {
|
||||
}
|
||||
}
|
||||
|
||||
if (lib.startsWith("net.minecraftforge:bootstrap:")) {
|
||||
if (extension.isForge() && extension.getForgeProvider().getVersion().getMajorVersion() >= Constants.Forge.MIN_BOOTSTRAP_DEV_VERSION) {
|
||||
String version = lib.substring(lib.lastIndexOf(":"));
|
||||
dependencies.add(project.getDependencies().create("net.minecraftforge:bootstrap-dev" + version));
|
||||
}
|
||||
}
|
||||
|
||||
if (dep == null) {
|
||||
dep = lib;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.gradle.api.Project;
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.configuration.DependencyInfo;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.loom.util.LoomVersions;
|
||||
import net.fabricmc.loom.util.ModPlatform;
|
||||
|
||||
public class ForgeProvider extends DependencyProvider {
|
||||
@@ -50,10 +49,6 @@ public class ForgeProvider extends DependencyProvider {
|
||||
version = new ForgeVersion(dependency.getResolvedVersion());
|
||||
addDependency(dependency.getDepString() + ":userdev", Constants.Configurations.FORGE_USERDEV);
|
||||
addDependency(dependency.getDepString() + ":installer", Constants.Configurations.FORGE_INSTALLER);
|
||||
|
||||
if (getExtension().isForge() && version.getMajorVersion() >= Constants.Forge.MIN_UNION_RELAUNCHER_VERSION) {
|
||||
addDependency(LoomVersions.UNION_RELAUNCHER.mavenNotation(), Constants.Configurations.FORGE_EXTRA);
|
||||
}
|
||||
}
|
||||
|
||||
public ForgeVersion getVersion() {
|
||||
|
||||
@@ -112,13 +112,6 @@ public record ForgeRunTemplate(
|
||||
|
||||
// Add MOD_CLASSES, this is something that ForgeGradle does
|
||||
settings.getEnvironmentVariables().computeIfAbsent("MOD_CLASSES", $ -> ConfigValue.of("{source_roots}").resolve(configValueResolver));
|
||||
|
||||
final ForgeProvider forgeProvider = settings.getExtension().getForgeProvider();
|
||||
|
||||
if (settings.getExtension().isForge() && forgeProvider.getVersion().getMajorVersion() >= Constants.Forge.MIN_UNION_RELAUNCHER_VERSION) {
|
||||
settings.defaultMainClass(Constants.Forge.UNION_RELAUNCHER_MAIN_CLASS);
|
||||
settings.property(Constants.Forge.UNION_RELAUNCHER_MAIN_CLASS_PROPERTY, main);
|
||||
}
|
||||
}
|
||||
|
||||
public Resolved resolve(ConfigValue.Resolver configValueResolver) {
|
||||
|
||||
@@ -128,6 +128,8 @@ public class ForgeRunsProvider {
|
||||
// Use a set-valued multimap for deduplicating paths.
|
||||
Multimap<String, String> modClasses = MultimapBuilder.hashKeys().linkedHashSetValues().build();
|
||||
NamedDomainObjectContainer<ModSettings> mods = extension.getMods();
|
||||
// Forge 49+ bootstrap-dev uses ; as a separator, instead of File.pathSeparator
|
||||
String separator = extension.getForgeProvider().getVersion().getMajorVersion() >= Constants.Forge.MIN_BOOTSTRAP_DEV_VERSION ? ";" : File.pathSeparator;
|
||||
|
||||
if (runConfig != null && !runConfig.getMods().isEmpty()) {
|
||||
mods = runConfig.getMods();
|
||||
@@ -147,7 +149,7 @@ public class ForgeRunsProvider {
|
||||
|
||||
string = modClasses.entries().stream()
|
||||
.map(entry -> entry.getKey() + "%%" + entry.getValue())
|
||||
.collect(Collectors.joining(File.pathSeparator));
|
||||
.collect(Collectors.joining(separator));
|
||||
} else if (key.equals("mcp_mappings")) {
|
||||
string = "loom.stub";
|
||||
} else if (json.has(key)) {
|
||||
|
||||
@@ -192,11 +192,9 @@ public class Constants {
|
||||
public static final String MIXIN_CONFIGS_MANIFEST_KEY = "MixinConfigs";
|
||||
|
||||
/**
|
||||
* The minimum Forge version that needs Union Relauncher to use {@code MOD_CLASSES}.
|
||||
* The minimum Forge version that needs bootstrap-dev to use {@code MOD_CLASSES}.
|
||||
*/
|
||||
public static final int MIN_UNION_RELAUNCHER_VERSION = 49;
|
||||
public static final String UNION_RELAUNCHER_MAIN_CLASS = "juuxel.unionrelauncher.UnionRelauncher";
|
||||
public static final String UNION_RELAUNCHER_MAIN_CLASS_PROPERTY = "unionRelauncher.mainClass";
|
||||
public static final int MIN_BOOTSTRAP_DEV_VERSION = 49;
|
||||
|
||||
/**
|
||||
* The minimum version of Forge that uses "mojang" as the namespace in production.
|
||||
|
||||
Reference in New Issue
Block a user