diff --git a/loader/src/main/java/net/neoforged/fml/loading/ImmediateWindowHandler.java b/loader/src/main/java/net/neoforged/fml/loading/ImmediateWindowHandler.java index 3de8245d4..98d48cfa4 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/ImmediateWindowHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/ImmediateWindowHandler.java @@ -46,7 +46,7 @@ public static void load(final String launchTarget, final String[] arguments) { LOGGER.debug("Invoking bootstrap method {}", bootstrap.name()); bootstrap.bootstrap(arguments); }); - if (!List.of("forgeclient", "forgeclientuserdev", "forgeclientdev").contains(launchTarget)) { + if (!List.of("neoforgeclient", "neoforgeclientdev", "neoforgeclientdev").contains(launchTarget)) { provider = new DummyProvider(); LOGGER.info("ImmediateWindowProvider not loading because launch target is {}", launchTarget); } else if (!FMLConfig.getBoolConfigValue(FMLConfig.ConfigValue.EARLY_WINDOW_CONTROL)) { diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonClientLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/CommonClientLaunchHandler.java deleted file mode 100644 index 5fd2f68b4..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonClientLaunchHandler.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import java.util.List; -import java.util.function.Consumer; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.fml.loading.MavenCoordinate; -import net.neoforged.fml.loading.VersionInfo; -import net.neoforged.fml.loading.moddiscovery.locators.ProductionClientProvider; -import net.neoforged.neoforgespi.locating.IModFileCandidateLocator; - -/** - * For production client environments (i.e. vanilla launcher). - */ -public abstract class CommonClientLaunchHandler extends CommonLaunchHandler { - @Override - public Dist getDist() { - return Dist.CLIENT; - } - - @Override - public boolean isProduction() { - return true; - } - - @Override - protected void runService(String[] arguments, ModuleLayer gameLayer) throws Throwable { - clientService(arguments, gameLayer); - } - - /** - * @return Additional artifacts from the Games libraries folder that should be layered on top of the Minecraft jar content. - */ - protected List getAdditionalMinecraftJarContent(VersionInfo versionInfo) { - return List.of(); - } - - @Override - public void collectAdditionalModFileLocators(VersionInfo versionInfo, Consumer output) { - super.collectAdditionalModFileLocators(versionInfo, output); - - var additionalContent = getAdditionalMinecraftJarContent(versionInfo); - output.accept(new ProductionClientProvider(additionalContent)); - } -} diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/CommonLaunchHandler.java index a51abf4d7..1eb2d1d4c 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonLaunchHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/CommonLaunchHandler.java @@ -41,10 +41,6 @@ public abstract class CommonLaunchHandler implements ILaunchHandlerService { public abstract boolean isProduction(); - public boolean isData() { - return false; - } - /** * Return additional locators to be used for locating mods when this launch handler is used. */ @@ -128,10 +124,6 @@ protected void serverService(final String[] arguments, final ModuleLayer layer) runTarget("net.minecraft.server.Main", arguments, layer); } - protected void dataService(final String[] arguments, final ModuleLayer layer) throws Throwable { - runTarget("net.minecraft.data.Main", arguments, layer); - } - protected void runTarget(final String target, final String[] arguments, final ModuleLayer layer) throws Throwable { Class.forName(layer.findModule("minecraft").orElseThrow(), target).getMethod("main", String[].class).invoke(null, (Object) arguments); } diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonServerLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/CommonServerLaunchHandler.java deleted file mode 100644 index fab0faf51..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonServerLaunchHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import java.util.List; -import java.util.function.Consumer; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.fml.loading.MavenCoordinate; -import net.neoforged.fml.loading.VersionInfo; -import net.neoforged.fml.loading.moddiscovery.locators.ProductionServerProvider; -import net.neoforged.neoforgespi.locating.IModFileCandidateLocator; - -/** - * For production dedicated server environments. - */ -public abstract class CommonServerLaunchHandler extends CommonLaunchHandler { - @Override - public Dist getDist() { - return Dist.DEDICATED_SERVER; - } - - @Override - public boolean isProduction() { - return true; - } - - @Override - protected void runService(String[] arguments, ModuleLayer gameLayer) throws Throwable { - serverService(arguments, gameLayer); - } - - /** - * @return Additional artifacts from the Games libraries folder that should be layered on top of the Minecraft jar content. - */ - protected List getAdditionalMinecraftJarContent(VersionInfo versionInfo) { - return List.of(); - } - - @Override - public void collectAdditionalModFileLocators(VersionInfo versionInfo, Consumer output) { - super.collectAdditionalModFileLocators(versionInfo, output); - var additionalContent = getAdditionalMinecraftJarContent(versionInfo); - output.accept(new ProductionServerProvider(additionalContent)); - } -} diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitDevLaunchTarget.java b/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitDevLaunchTarget.java index 9ff067240..63816f4a8 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitDevLaunchTarget.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitDevLaunchTarget.java @@ -10,7 +10,7 @@ /** * A launch target for bootstrapping a slim Minecraft environment in forgedev, to be used in JUnit tests. */ -public class JUnitDevLaunchTarget extends CommonDevLaunchHandler { +public class JUnitDevLaunchTarget extends NeoForgeDevLaunchHandler { @Override public Dist getDist() { return Dist.DEDICATED_SERVER; diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitUserDevLaunchTarget.java b/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitUserDevLaunchTarget.java deleted file mode 100644 index 9b1e029d5..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/JUnitUserDevLaunchTarget.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import net.neoforged.api.distmarker.Dist; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A launch target for bootstrapping a slim Minecraft environment in userdev, to be used in JUnit tests. - * - * @deprecated Use {@link JUnitDevLaunchTarget} instead. - */ -@Deprecated(forRemoval = true) -public class JUnitUserDevLaunchTarget extends CommonDevLaunchHandler { - private static final Logger LOG = LoggerFactory.getLogger(JUnitUserDevLaunchTarget.class); - - @Override - public Dist getDist() { - return Dist.DEDICATED_SERVER; - } - - @Override - protected void runService(String[] arguments, ModuleLayer gameLayer) throws Throwable { - LOG.warn("Using deprecated launch target forgejunituserdev. Use forgejunitdev instead."); - Class.forName(gameLayer.findModule("neoforge").orElseThrow(), "net.neoforged.neoforge.junit.JUnitMain").getMethod("main", String[].class).invoke(null, (Object) arguments); - } - - @Override - public String name() { - return "forgejunituserdev"; - } -} diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataDevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDataDevLaunchHandler.java similarity index 66% rename from loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataDevLaunchHandler.java rename to loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDataDevLaunchHandler.java index 6dbabd627..bcfe8b8e3 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataDevLaunchHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDataDevLaunchHandler.java @@ -7,10 +7,10 @@ import net.neoforged.api.distmarker.Dist; -public class NeoForgeDataDevLaunchHandler extends CommonDevLaunchHandler { +public class NeoForgeClientDataDevLaunchHandler extends NeoForgeDevLaunchHandler { @Override public String name() { - return "forgedatadev"; + return "neoforgeclientdatadev"; } @Override @@ -18,13 +18,8 @@ public Dist getDist() { return Dist.CLIENT; } - @Override - public boolean isData() { - return true; - } - @Override public void runService(String[] arguments, ModuleLayer layer) throws Throwable { - dataService(arguments, layer); + runTarget("net.minecraft.client.data.Main", arguments, layer); } } diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDevLaunchHandler.java index 430219e31..54d812716 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDevLaunchHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientDevLaunchHandler.java @@ -5,12 +5,14 @@ package net.neoforged.fml.loading.targets; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import net.neoforged.api.distmarker.Dist; -public class NeoForgeClientDevLaunchHandler extends CommonDevLaunchHandler { +public class NeoForgeClientDevLaunchHandler extends NeoForgeDevLaunchHandler { @Override public String name() { - return "forgeclientdev"; + return "neoforgeclientdev"; } @Override @@ -18,8 +20,37 @@ public Dist getDist() { return Dist.CLIENT; } + @Override + protected String[] preLaunch(String[] arguments, ModuleLayer layer) { + var args = ArgumentList.from(arguments); + + String username = args.get("username"); + if (username != null) { // Replace '#' placeholders with random numbers + Matcher m = Pattern.compile("#+").matcher(username); + var replaced = new StringBuilder(); + while (m.find()) { + m.appendReplacement(replaced, getRandomNumbers(m.group().length())); + } + m.appendTail(replaced); + args.put("username", replaced.toString()); + } else { + args.putLazy("username", "Dev"); + } + + if (!args.hasValue("accessToken")) { + args.put("accessToken", "0"); + } + + return super.preLaunch(arguments, layer); + } + @Override public void runService(String[] arguments, ModuleLayer layer) throws Throwable { clientService(arguments, layer); } + + private static String getRandomNumbers(int length) { + // Generate a time-based random number, to mimic how n.m.client.Main works + return Long.toString(System.nanoTime() % (int) Math.pow(10, length)); + } } diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientLaunchHandler.java index f9413d0a3..36ba2c796 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientLaunchHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientLaunchHandler.java @@ -7,29 +7,46 @@ import java.util.List; import java.util.function.Consumer; +import net.neoforged.api.distmarker.Dist; import net.neoforged.fml.loading.LibraryFinder; import net.neoforged.fml.loading.MavenCoordinate; import net.neoforged.fml.loading.VersionInfo; import net.neoforged.fml.loading.moddiscovery.locators.PathBasedLocator; +import net.neoforged.fml.loading.moddiscovery.locators.ProductionClientProvider; import net.neoforged.neoforgespi.locating.IModFileCandidateLocator; -public class NeoForgeClientLaunchHandler extends CommonClientLaunchHandler { +/** + * For production client environments (i.e. vanilla launcher). + */ +public class NeoForgeClientLaunchHandler extends CommonLaunchHandler { @Override public String name() { - return "forgeclient"; + return "neoforgeclient"; } - /** - * Overlays the unpatched but renamed Minecraft classes with our patched versions of those classes. - */ @Override - protected List getAdditionalMinecraftJarContent(VersionInfo versionInfo) { - return List.of(new MavenCoordinate("net.neoforged", "neoforge", "", "client", versionInfo.neoForgeVersion())); + public Dist getDist() { + return Dist.CLIENT; + } + + @Override + public boolean isProduction() { + return true; + } + + @Override + protected void runService(String[] arguments, ModuleLayer gameLayer) throws Throwable { + clientService(arguments, gameLayer); } @Override public void collectAdditionalModFileLocators(VersionInfo versionInfo, Consumer output) { super.collectAdditionalModFileLocators(versionInfo, output); + + // Overlays the unpatched but renamed Minecraft classes with our patched versions of those classes. + var additionalContent = List.of(new MavenCoordinate("net.neoforged", "neoforge", "", "client", versionInfo.neoForgeVersion())); + output.accept(new ProductionClientProvider(additionalContent)); + var nfJar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.neoForgeVersion()); output.accept(new PathBasedLocator("neoforge", nfJar)); } diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientUserdevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientUserdevLaunchHandler.java deleted file mode 100644 index 486cf8d0b..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeClientUserdevLaunchHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import net.neoforged.api.distmarker.Dist; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @deprecated Use {@link NeoForgeClientDevLaunchHandler} instead. - */ -@Deprecated(forRemoval = true) -public class NeoForgeClientUserdevLaunchHandler extends CommonDevLaunchHandler { - private static final Logger LOG = LoggerFactory.getLogger(NeoForgeClientUserdevLaunchHandler.class); - - @Override - public String name() { - return "forgeclientuserdev"; - } - - @Override - public Dist getDist() { - return Dist.CLIENT; - } - - @Override - public void runService(String[] arguments, ModuleLayer layer) throws Throwable { - LOG.warn("Using deprecated launch target forgeclientuserdev. Use forgeclientdev instead."); - clientService(arguments, layer); - } -} diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataUserdevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataUserdevLaunchHandler.java deleted file mode 100644 index 3447732e8..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDataUserdevLaunchHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import net.neoforged.api.distmarker.Dist; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @deprecated Use {@link NeoForgeDataDevLaunchHandler} instead. - */ -@Deprecated(forRemoval = true) -public class NeoForgeDataUserdevLaunchHandler extends CommonDevLaunchHandler { - private static final Logger LOG = LoggerFactory.getLogger(NeoForgeDataUserdevLaunchHandler.class); - - @Override - public String name() { - return "forgedatauserdev"; - } - - @Override - public Dist getDist() { - return Dist.CLIENT; - } - - @Override - public boolean isData() { - return true; - } - - @Override - public void runService(String[] arguments, ModuleLayer layer) throws Throwable { - LOG.warn("Using deprecated launch target forgedatauserdev. Use forgedatadev instead."); - dataService(arguments, layer); - } -} diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonDevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDevLaunchHandler.java similarity index 63% rename from loader/src/main/java/net/neoforged/fml/loading/targets/CommonDevLaunchHandler.java rename to loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDevLaunchHandler.java index a093d00d7..76a661ee7 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/CommonDevLaunchHandler.java +++ b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeDevLaunchHandler.java @@ -8,8 +8,6 @@ import java.nio.file.Files; import java.util.List; import java.util.function.Consumer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import net.neoforged.fml.loading.VersionInfo; import net.neoforged.fml.loading.moddiscovery.locators.NeoForgeDevProvider; import net.neoforged.fml.loading.moddiscovery.locators.UserdevLocator; @@ -21,8 +19,8 @@ /** * For the NeoForge development environment. */ -public abstract class CommonDevLaunchHandler extends CommonLaunchHandler { - private static final Logger LOG = LoggerFactory.getLogger(CommonDevLaunchHandler.class); +public abstract class NeoForgeDevLaunchHandler extends CommonLaunchHandler { + private static final Logger LOG = LoggerFactory.getLogger(NeoForgeDevLaunchHandler.class); /** * A file we expect to find in the classpath entry that contains the Minecraft code. @@ -64,41 +62,4 @@ public void collectAdditionalModFileLocators(VersionInfo versionInfo, Consumer getAdditionalMinecraftJarContent(VersionInfo versionInfo) { - return List.of(new MavenCoordinate("net.neoforged", "neoforge", "", "server", versionInfo.neoForgeVersion())); + protected void runService(String[] arguments, ModuleLayer gameLayer) throws Throwable { + serverService(arguments, gameLayer); } @Override public void collectAdditionalModFileLocators(VersionInfo versionInfo, Consumer output) { super.collectAdditionalModFileLocators(versionInfo, output); + // Overlays the unpatched but renamed Minecraft classes with our patched versions of those classes. + var additionalContent = List.of(new MavenCoordinate("net.neoforged", "neoforge", "", "server", versionInfo.neoForgeVersion())); + output.accept(new ProductionServerProvider(additionalContent)); var nfJar = LibraryFinder.findPathForMaven("net.neoforged", "neoforge", "", "universal", versionInfo.neoForgeVersion()); output.accept(new PathBasedLocator("neoforge", nfJar)); diff --git a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeServerUserdevLaunchHandler.java b/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeServerUserdevLaunchHandler.java deleted file mode 100644 index 04d942419..000000000 --- a/loader/src/main/java/net/neoforged/fml/loading/targets/NeoForgeServerUserdevLaunchHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.loading.targets; - -import net.neoforged.api.distmarker.Dist; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @deprecated Use {@link NeoForgeServerDevLaunchHandler} instead. - */ -@Deprecated(forRemoval = true) -public class NeoForgeServerUserdevLaunchHandler extends CommonDevLaunchHandler { - private static final Logger LOG = LoggerFactory.getLogger(NeoForgeServerUserdevLaunchHandler.class); - - @Override - public String name() { - return "forgeserveruserdev"; - } - - @Override - public Dist getDist() { - return Dist.DEDICATED_SERVER; - } - - @Override - public void runService(String[] arguments, ModuleLayer layer) throws Throwable { - LOG.warn("Using deprecated launch target forgeserveruserdev. Use forgeserverdev instead."); - serverService(arguments, layer); - } -} diff --git a/loader/src/main/resources/META-INF/services/cpw.mods.modlauncher.api.ILaunchHandlerService b/loader/src/main/resources/META-INF/services/cpw.mods.modlauncher.api.ILaunchHandlerService index 39231d1b7..410610667 100644 --- a/loader/src/main/resources/META-INF/services/cpw.mods.modlauncher.api.ILaunchHandlerService +++ b/loader/src/main/resources/META-INF/services/cpw.mods.modlauncher.api.ILaunchHandlerService @@ -1,10 +1,7 @@ net.neoforged.fml.loading.targets.NeoForgeClientLaunchHandler net.neoforged.fml.loading.targets.NeoForgeClientDevLaunchHandler -net.neoforged.fml.loading.targets.NeoForgeClientUserdevLaunchHandler +net.neoforged.fml.loading.targets.NeoForgeClientDataDevLaunchHandler net.neoforged.fml.loading.targets.NeoForgeServerLaunchHandler net.neoforged.fml.loading.targets.NeoForgeServerDevLaunchHandler -net.neoforged.fml.loading.targets.NeoForgeServerUserdevLaunchHandler -net.neoforged.fml.loading.targets.NeoForgeDataDevLaunchHandler -net.neoforged.fml.loading.targets.NeoForgeDataUserdevLaunchHandler +net.neoforged.fml.loading.targets.NeoForgeServerDataDevLaunchHandler net.neoforged.fml.loading.targets.JUnitDevLaunchTarget -net.neoforged.fml.loading.targets.JUnitUserDevLaunchTarget diff --git a/loader/src/test/java/net/neoforged/fml/common/asm/RuntimeDistCleanerTest.java b/loader/src/test/java/net/neoforged/fml/common/asm/RuntimeDistCleanerTest.java index 20e424a8d..dadf624ea 100644 --- a/loader/src/test/java/net/neoforged/fml/common/asm/RuntimeDistCleanerTest.java +++ b/loader/src/test/java/net/neoforged/fml/common/asm/RuntimeDistCleanerTest.java @@ -127,7 +127,7 @@ private void transformTestClass(Dist dist, @Language("java") String classContent .addClass("test.Test", classContent) .build(); - launchAndLoad(dist.isClient() ? "forgeclient" : "forgeserver"); + launchAndLoad(dist.isClient() ? "neoforgeclient" : "neoforgeserver"); var testClass = Class.forName("test.Test", true, gameClassLoader); asserter.accept(testClass); diff --git a/loader/src/test/java/net/neoforged/fml/common/asm/enumextension/RuntimeEnumExtenderTest.java b/loader/src/test/java/net/neoforged/fml/common/asm/enumextension/RuntimeEnumExtenderTest.java index 25aa05273..a1d9e089f 100644 --- a/loader/src/test/java/net/neoforged/fml/common/asm/enumextension/RuntimeEnumExtenderTest.java +++ b/loader/src/test/java/net/neoforged/fml/common/asm/enumextension/RuntimeEnumExtenderTest.java @@ -26,7 +26,7 @@ void testMissingPath() throws Exception { .withModsToml(getModsTomlBuilderConsumer("xyz")) .build(); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: Enum extender file xyz, provided by mod testmod, does not exist"); } @@ -60,7 +60,7 @@ public static ExtensionInfo getExtensionInfo() { """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); Class enumClass = getEnumClass("testmod.SomeEnum"); @@ -143,7 +143,7 @@ public class TestMod { } """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var noArgEnum = getEnumClass("testmod.NoArgEnum"); var stringArgEnum = getEnumClass("testmod.StringArgEnum"); @@ -218,7 +218,7 @@ public static Object getIdEnumParameter(int idx, Class type) { } """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var extensibleEnum = getEnumClass("enumtestmod.ExtensibleEnum"); assertThat(extensibleEnum.getEnumConstants()).extracting(Enum::name).containsExactly( @@ -304,7 +304,7 @@ public static Object getIdEnumParameter(int idx, Class type) { } """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var enumWithId = getEnumClass("enumtestmod.EnumWithId"); assertThat(enumWithId.getEnumConstants()).extracting(Enum::name).containsExactly( @@ -342,7 +342,7 @@ public static ExtensionInfo getExtensionInfo() { } """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var extensibleEnum = getEnumClass("testmod.SomeEnum"); var extensionInfo = getExtensionInfo(extensibleEnum); @@ -383,7 +383,7 @@ public static ExtensionInfo getExtensionInfo() { } """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var extensibleEnum = getEnumClass("testmod.SomeEnum"); var extensionInfo = getExtensionInfo(extensibleEnum); diff --git a/loader/src/test/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProviderTest.java b/loader/src/test/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProviderTest.java index 0c6b04411..62cfd9725 100644 --- a/loader/src/test/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProviderTest.java +++ b/loader/src/test/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProviderTest.java @@ -50,7 +50,7 @@ class DanglingEntryPoint { .compile(); } - var e = Assertions.assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = Assertions.assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())) .containsOnly("ERROR: File mods/test.jar contains mod entrypoint class testmod.DanglingEntryPoint for mod with id notthismod, which does not exist or is not in the same file." + "\nDid you forget to update the mod id in the entrypoint?"); @@ -74,7 +74,7 @@ class EntryPoint { .compile(); } - var e = Assertions.assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = Assertions.assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())) .containsOnly("ERROR: testmod (testmod) has failed to load correctly" + "\njava.lang.RuntimeException: Mod class class testmod.EntryPoint must have exactly 1 public constructor, found 0"); @@ -99,7 +99,7 @@ public EntryPoint(net.neoforged.bus.api.IEventBus modEventBus) { .compile(); } - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); ModLoader.dispatchParallelEvent("test", Runnable::run, Runnable::run, () -> {}, FMLClientSetupEvent::new); @@ -132,7 +132,7 @@ public ClientEntryPoint() { .compile(); } - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); assertThat(MESSAGES).isEqualTo(List.of("common", "client")); } @@ -157,7 +157,7 @@ public EntryPoint(net.neoforged.bus.api.IEventBus modEventBus) { """) .build(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var e = Assertions.assertThrows(ModLoadingException.class, () -> { ModLoader.dispatchParallelEvent("test", Runnable::run, Runnable::run, () -> {}, FMLClientSetupEvent::new); diff --git a/loader/src/test/java/net/neoforged/fml/loading/ClasspathTransformerDiscovererTest.java b/loader/src/test/java/net/neoforged/fml/loading/ClasspathTransformerDiscovererTest.java index 8acdb90e0..4a5d7b396 100644 --- a/loader/src/test/java/net/neoforged/fml/loading/ClasspathTransformerDiscovererTest.java +++ b/loader/src/test/java/net/neoforged/fml/loading/ClasspathTransformerDiscovererTest.java @@ -38,7 +38,7 @@ void setUp() throws IOException { @Test void testLocateTransformerServiceInDev() throws Exception { - var candidates = runLocator("forgeclientdev"); + var candidates = runLocator("neoforgeclientdev"); assertThat(candidates) .anySatisfy(candidate -> { @@ -53,7 +53,7 @@ void testLocateTransformerServiceInDev() throws Exception { @Test void testLocateTransformerServiceNotInDev() throws Exception { - var candidates = runLocator("forgeclient"); + var candidates = runLocator("neoforgeclient"); assertThat(candidates).isEmpty(); } diff --git a/loader/src/test/java/net/neoforged/fml/loading/CoreModTest.java b/loader/src/test/java/net/neoforged/fml/loading/CoreModTest.java index bf4945ae6..665265d0e 100644 --- a/loader/src/test/java/net/neoforged/fml/loading/CoreModTest.java +++ b/loader/src/test/java/net/neoforged/fml/loading/CoreModTest.java @@ -68,7 +68,7 @@ public class TestCoreMod implements net.neoforged.neoforgespi.coremod.ICoreMod { }) .build(); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: An error occurred while loading core-mod testmod.coremods.TestCoreMod from mods/testmod.jar > coremod-1.0.jar"); } @@ -88,7 +88,7 @@ public class TestCoreMod implements net.neoforged.neoforgespi.coremod.ICoreMod { }}""") .build(); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: An error occurred while loading core-mod testmod.coremods.TestCoreMod from mods/coremod.jar"); } @@ -115,7 +115,7 @@ public class TestCoreMod implements net.neoforged.neoforgespi.coremod.ICoreMod { }) .build(); - var transformers = launchAndLoad("forgeclient").transformers(); + var transformers = launchAndLoad("neoforgeclient").transformers(); assertThat(transformers).containsOnly(TEST_TRANSFORMER); var testClass = Class.forName("testmod.TestClass", true, gameClassLoader); @@ -153,7 +153,7 @@ function initializeCoreMod() { """) .build(); - var transformers = launchAndLoad("forgeclient").transformers(); + var transformers = launchAndLoad("neoforgeclient").transformers(); assertThat(transformers).hasSize(1); var transformer = (ITransformer) transformers.getFirst(); assertThat(transformer.getTargetType()).isEqualTo(TargetType.CLASS); diff --git a/loader/src/test/java/net/neoforged/fml/loading/FMLLoaderTest.java b/loader/src/test/java/net/neoforged/fml/loading/FMLLoaderTest.java index 43a44f0af..168e5f203 100644 --- a/loader/src/test/java/net/neoforged/fml/loading/FMLLoaderTest.java +++ b/loader/src/test/java/net/neoforged/fml/loading/FMLLoaderTest.java @@ -36,7 +36,7 @@ class WithoutMods { void testProductionClientDiscovery() throws Exception { installation.setupProductionClient(); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.pluginLayerModules()).isEmpty(); @@ -49,7 +49,7 @@ void testProductionClientDiscovery() throws Exception { void testProductionServerDiscovery() throws Exception { installation.setupProductionServer(); - var result = launchAndLoad("forgeserver"); + var result = launchAndLoad("neoforgeserver"); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -61,7 +61,7 @@ void testProductionServerDiscovery() throws Exception { @Test void testNeoForgeDevServerDiscovery() throws Exception { - var result = launchAndLoadInNeoForgeDevEnvironment("forgeserverdev"); + var result = launchAndLoadInNeoForgeDevEnvironment("neoforgeserverdev"); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -72,8 +72,20 @@ void testNeoForgeDevServerDiscovery() throws Exception { } @Test - void testNeoForgeDevDataDiscovery() throws Exception { - var result = launchAndLoadInNeoForgeDevEnvironment("forgedatadev"); + void testNeoForgeDevClientDataDiscovery() throws Exception { + var result = launchAndLoadInNeoForgeDevEnvironment("neoforgeclientdatadev"); + assertThat(result.issues()).isEmpty(); + assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); + assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); + assertThat(result.pluginLayerModules()).isEmpty(); + + installation.assertMinecraftClientJar(result); + installation.assertNeoForgeJar(result); + } + + @Test + void testNeoForgeDevServerDataDiscovery() throws Exception { + var result = launchAndLoadInNeoForgeDevEnvironment("neoforgeserverdatadev"); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -85,7 +97,7 @@ void testNeoForgeDevDataDiscovery() throws Exception { @Test void testNeoForgeDevClientDiscovery() throws Exception { - var result = launchAndLoadInNeoForgeDevEnvironment("forgeclientdev"); + var result = launchAndLoadInNeoForgeDevEnvironment("neoforgeclientdev"); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -99,7 +111,21 @@ void testNeoForgeDevClientDiscovery() throws Exception { void testUserDevServerDiscovery() throws Exception { var classpath = installation.setupUserdevProject(); - var result = launchAndLoadWithAdditionalClasspath("forgeserveruserdev", classpath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeserverdev", classpath); + assertThat(result.issues()).isEmpty(); + assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); + assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); + assertThat(result.pluginLayerModules()).isEmpty(); + + installation.assertMinecraftClientJar(result); + installation.assertNeoForgeJar(result); + } + + @Test + void testUserServerDevDataDiscovery() throws Exception { + var classpath = installation.setupUserdevProject(); + + var result = launchAndLoadWithAdditionalClasspath("neoforgeserverdatadev", classpath); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -110,10 +136,10 @@ void testUserDevServerDiscovery() throws Exception { } @Test - void testUserDevDataDiscovery() throws Exception { + void testUserClientDevDataDiscovery() throws Exception { var classpath = installation.setupUserdevProject(); - var result = launchAndLoadWithAdditionalClasspath("forgedatauserdev", classpath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdatadev", classpath); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -127,7 +153,7 @@ void testUserDevDataDiscovery() throws Exception { void testUserDevClientDiscovery() throws Exception { var classpath = installation.setupUserdevProject(); - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", classpath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", classpath); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge"); @@ -146,7 +172,7 @@ void testProductionClientDiscovery() throws Exception { installation.setupModInModsFolder("testmod1", "1.0"); installation.setupModInModsFolder("testmod1", "1.0"); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(result.issues()).isEmpty(); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge", "testmod1"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "neoforge", "testmod1"); @@ -165,7 +191,7 @@ void testPlainJarInModsFolderIsNotLoadedButWarnedAbout() throws Exception { installation.setupProductionClient(); installation.setupPlainJarInModsFolder("plainmod.jar"); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(result.gameLayerModules()).doesNotContainKey("plainmod"); assertThat(result.pluginLayerModules()).doesNotContainKey("plainmod"); @@ -195,7 +221,7 @@ void testJarInJar() throws Exception { new ContainedJarMetadata(new ContainedJarIdentifier("modgroup", "embedded-gamelib"), JIJ_V1, "META-INF/jarjar/embedded_gamelib-1.0.jar", false), new ContainedJarMetadata(new ContainedJarIdentifier("modgroup", "embedded-lib"), JIJ_V1, "META-INF/jarjar/embedded_lib-1.0.jar", false))); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(result.gameLayerModules()).containsOnlyKeys("minecraft", "embeddedmod", "embedded.gamelib", "jijmod", "neoforge"); assertThat(result.pluginLayerModules()).containsOnlyKeys("embedded.lib", "embedded.service"); assertThat(result.loadedMods()).containsOnlyKeys("minecraft", "neoforge", "embeddedmod", "jijmod"); @@ -212,7 +238,7 @@ void testHighestVersionWins() throws Exception { installation.setupModInModsFolder("testmod1", "12.0"); installation.setupModInModsFolder("testmod1", "3.0"); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); var loadedMod = result.loadedMods().get("testmod1"); assertNotNull(loadedMod); @@ -232,7 +258,7 @@ void testUserdevWithModProject() throws Exception { // Tell FML that the classes and resources directory belong together SimulatedInstallation.setModFoldersProperty(Map.of("mod", mainModule)); - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", additionalClasspath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", additionalClasspath); assertThat(result.pluginLayerModules()).doesNotContainKey("mod"); assertThat(result.gameLayerModules()).containsKey("mod"); installation.assertModContent(result, "mod", List.of(entrypointClass, modManifest)); @@ -255,7 +281,7 @@ void testUserdevWithModProjectNotOnClasspath() throws Exception { // Tell FML that the classes and resources directory belong together SimulatedInstallation.setModFoldersProperty(Map.of("mod", mainModule)); - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", additionalClasspath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", additionalClasspath); assertThat(result.pluginLayerModules()).doesNotContainKey("mod"); assertThat(result.gameLayerModules()).containsKey("mod"); installation.assertModContent(result, "mod", List.of(entrypointClass, modManifest)); @@ -274,7 +300,7 @@ void testUserdevWithServiceProject() throws Exception { // Tell FML that the classes and resources directory belong together SimulatedInstallation.setModFoldersProperty(Map.of("mod", mainModule)); - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", additionalClasspath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", additionalClasspath); assertThat(result.pluginLayerModules()).containsKey("mod"); assertThat(result.gameLayerModules()).doesNotContainKey("mod"); assertThat(result.loadedMods()).doesNotContainKey("mod"); @@ -299,7 +325,7 @@ void testUserdevWithModLauncherServiceProject() throws Exception { SimulatedInstallation.setModFoldersProperty(Map.of("mod", mainModule)); locatedPaths.add(mainModule.getFirst()); // Mark the primary path as located by ML so it gets skipped by FML - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", additionalClasspath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", additionalClasspath); assertThat(result.pluginLayerModules()).doesNotContainKey("mod"); assertThat(result.gameLayerModules()).doesNotContainKey("mod"); assertThat(result.loadedMods()).doesNotContainKey("mod"); @@ -325,7 +351,7 @@ void testIncompatibleLoaderVersions(String requestedLoader, String requestedVers .addMod("testmod")) .build(); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly(expectedError); } @@ -336,7 +362,7 @@ void testCorruptedServerInstallation() throws Exception { var serverPath = installation.getLibrariesDir().resolve("net/minecraft/server/1.20.4-202401020304/server-1.20.4-202401020304-srg.jar"); Files.delete(serverPath); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeserver")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeserver")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: Your NeoForge installation is corrupted, please try to reinstall"); } @@ -348,7 +374,7 @@ void testCorruptedClientInstallation() throws Exception { var clientPath = installation.getLibrariesDir().resolve("net/minecraft/client/1.20.4-202401020304/client-1.20.4-202401020304-srg.jar"); Files.delete(clientPath); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: Your NeoForge installation is corrupted, please try to reinstall"); } @@ -362,7 +388,7 @@ void testInvalidSubclassOfModFile() throws Exception { installation.writeModJar("test.jar", CustomSubclassModFileReader.TRIGGER); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: A technical error occurred during mod loading: Unexpected IModFile subclass: class net.neoforged.neoforgespi.locating.IModFile"); } @@ -388,7 +414,7 @@ void testUnsatisfiedNeoForgeRange() throws Exception { side="BOTH" """.getBytes())); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly("ERROR: Mod testproject requires neoforge 999.6 or above\nCurrently, neoforge is 1\n"); } @@ -399,7 +425,7 @@ void testDuplicateMods() throws Exception { installation.writeModJar("test1.jar", SimulatedInstallation.createMultiModsToml("mod_a", "1.0", "mod_c", "1.0")); installation.writeModJar("test2.jar", SimulatedInstallation.createMultiModsToml("mod_b", "1.0", "mod_c", "1.0")); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: Mod mod_c is present in multiple files: test2.jar, test1.jar"); } @@ -416,7 +442,7 @@ void testMissingOrUnsatisfiedForgeFeatures() throws Exception { "thisFeatureDoesNotExist", "*"))) .build(); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: testmod (testmod) is missing a feature it requires to run" + "\nIt requires javaVersion 999 but " + System.getProperty("java.version") + " is available", @@ -442,7 +468,7 @@ public Thrower(net.neoforged.bus.api.IEventBus modEventBus) { """) .build(); - var launchResult = launchAndLoad("forgeclient"); + var launchResult = launchAndLoad("neoforgeclient"); assertThat(launchResult.loadedMods()).containsKey("testmod"); var e = assertThrows(ModLoadingException.class, () -> ModLoader.dispatchParallelEvent("test", ModWorkManager.syncExecutor(), ModWorkManager.parallelExecutor(), () -> {}, FMLClientSetupEvent::new)); @@ -455,7 +481,7 @@ public Thrower(net.neoforged.bus.api.IEventBus modEventBus) { void testExceptionInInitTaskIsCollectedAsModLoadingIssue() throws Exception { installation.setupProductionClient(); - launchAndLoad("forgeclient"); + launchAndLoad("neoforgeclient"); var e = assertThrows(ModLoadingException.class, () -> ModLoader.runInitTask("test", ModWorkManager.syncExecutor(), () -> {}, () -> { throw new IllegalStateException("Exception Message"); })); diff --git a/loader/src/test/java/net/neoforged/fml/loading/InvalidModFileTests.java b/loader/src/test/java/net/neoforged/fml/loading/InvalidModFileTests.java index d6d90d4f3..0a4859bba 100644 --- a/loader/src/test/java/net/neoforged/fml/loading/InvalidModFileTests.java +++ b/loader/src/test/java/net/neoforged/fml/loading/InvalidModFileTests.java @@ -29,7 +29,7 @@ void testProductionClient(String ignored, List content, Str // In production we expect these to be warnings expectedError = "WARNING: " + expectedError; - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(getTranslatedIssues(result)).containsOnly(expectedError); } @@ -49,7 +49,7 @@ void testModDev(String ignored, List content, String expect // Tell FML that the classes and resources directory belong together SimulatedInstallation.setModFoldersProperty(Map.of("mod", mainModule)); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoadWithAdditionalClasspath("forgeclientuserdev", classpath)); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoadWithAdditionalClasspath("neoforgeclientdev", classpath)); assertThat(getTranslatedIssues(e.getIssues())).containsOnly(expectedError); } @@ -60,7 +60,7 @@ void testInvalidJarFile() throws Exception { var path = installation.getModsFolder().resolve("mod.jar"); Files.write(path, new byte[] { 1, 2, 3 }); - var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("forgeclient")); + var e = assertThrows(ModLoadingException.class, () -> launchAndLoad("neoforgeclient")); // Clear the cause, otherwise equality will fail assertThat(getTranslatedIssues(e.getIssues())).containsOnly( "ERROR: File mods/mod.jar is not a jar file"); @@ -73,7 +73,7 @@ void testFileIsDirectoryInProduction() throws Exception { var path = installation.getModsFolder().resolve("mod.jar"); Files.createDirectories(path); - var result = launchAndLoad("forgeclient"); + var result = launchAndLoad("neoforgeclient"); assertThat(getTranslatedIssues(result)).containsOnly("WARNING: File mods/mod.jar is not a valid mod file"); } @@ -89,7 +89,7 @@ void testFileIsDirectoryInDevSucceeds() throws Exception { Files.createDirectories(folder); classpath.add(folder); - var result = launchAndLoadWithAdditionalClasspath("forgeclientuserdev", classpath); + var result = launchAndLoadWithAdditionalClasspath("neoforgeclientdev", classpath); assertThat(result.issues()).isEmpty(); }