From 6baddc7e261d959301392e02787cea4aebd1d986 Mon Sep 17 00:00:00 2001 From: cpw Date: Tue, 1 Jan 2019 21:35:23 -0500 Subject: [PATCH] client and server work standalone and in forge dev. Next up userdev. Moved some launchplugin code to the launcher. Moved servermain to the launcher. server currently needs cmdline arguments --fml.forgeVersion=24.0.51-1.13-pre --fml.mcVersion=1.13 --fml.mcpVersion=2018.09.12.04.11.00 --fml.forgeGroup=net.minecraftforge.test --- build.gradle | 2 +- .../asm/CapabilityInjectDefinalize.java | 0 .../common/asm/ObjectHolderDefinalize.java | 0 .../common/asm/RuntimeEnumExtender.java | 2 +- .../loading}/AdvancedLogMessageAdapter.java | 2 +- .../fml/loading/FMLCommonLaunchHandler.java | 2 +- .../loading/FMLDevClientLaunchProvider.java | 12 ++++++--- .../loading/FMLDevServerLaunchProvider.java | 27 +++++++++++++++++-- .../fml/loading/FMLServerLaunchProvider.java | 13 +++++++++ .../net/minecraftforge/server/ServerMain.java | 0 .../resources/META-INF/defaultfmlconfig.toml | 0 ...odlauncher.serviceapi.ILaunchPluginService | 3 +++ .../net/minecraftforge/common/ForgeMod.java | 3 +++ .../net/minecraftforge/fml/LaunchTesting.java | 4 ++- .../fml/javafmlmod/FMLModContainer.java | 1 + .../relauncher/libraries/LibraryManager.java | 5 ++-- .../fml/relauncher/libraries/ModList.java | 5 ++-- .../versions/forge/ForgeVersion.java | 21 ++++----------- ...odlauncher.serviceapi.ILaunchPluginService | 3 --- 19 files changed, 71 insertions(+), 34 deletions(-) rename src/{main => fmllauncher}/java/net/minecraftforge/common/asm/CapabilityInjectDefinalize.java (100%) rename src/{main => fmllauncher}/java/net/minecraftforge/common/asm/ObjectHolderDefinalize.java (100%) rename src/{main => fmllauncher}/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java (99%) rename src/{main/java/net/minecraftforge/fml => fmllauncher/java/net/minecraftforge/fml/loading}/AdvancedLogMessageAdapter.java (97%) rename src/{main => fmllauncher}/java/net/minecraftforge/server/ServerMain.java (100%) rename src/{main => fmllauncher}/resources/META-INF/defaultfmlconfig.toml (100%) delete mode 100644 src/main/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService diff --git a/build.gradle b/build.gradle index e4b6dec00..12ed83a0f 100644 --- a/build.gradle +++ b/build.gradle @@ -251,7 +251,7 @@ project(':forge') { installer 'org.ow2.asm:asm:6.2' installer 'org.ow2.asm:asm-commons:6.2' installer 'org.ow2.asm:asm-tree:6.2' - installer 'cpw.mods:modlauncher:0.1.0' + installer 'cpw.mods:modlauncher:0.2.0' installer 'net.minecraftforge:accesstransformers:0.10+:shadowed' installer 'net.minecraftforge:eventbus:0.1+:service' installer 'net.minecraftforge:forgespi:0.1+' diff --git a/src/main/java/net/minecraftforge/common/asm/CapabilityInjectDefinalize.java b/src/fmllauncher/java/net/minecraftforge/common/asm/CapabilityInjectDefinalize.java similarity index 100% rename from src/main/java/net/minecraftforge/common/asm/CapabilityInjectDefinalize.java rename to src/fmllauncher/java/net/minecraftforge/common/asm/CapabilityInjectDefinalize.java diff --git a/src/main/java/net/minecraftforge/common/asm/ObjectHolderDefinalize.java b/src/fmllauncher/java/net/minecraftforge/common/asm/ObjectHolderDefinalize.java similarity index 100% rename from src/main/java/net/minecraftforge/common/asm/ObjectHolderDefinalize.java rename to src/fmllauncher/java/net/minecraftforge/common/asm/ObjectHolderDefinalize.java diff --git a/src/main/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java b/src/fmllauncher/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java similarity index 99% rename from src/main/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java rename to src/fmllauncher/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java index 36f4ec8e0..d97415ea7 100644 --- a/src/main/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java +++ b/src/fmllauncher/java/net/minecraftforge/common/asm/RuntimeEnumExtender.java @@ -21,7 +21,7 @@ package net.minecraftforge.common.asm; import java.nio.file.Path; -import net.minecraftforge.fml.AdvancedLogMessageAdapter; +import net.minecraftforge.fml.loading.AdvancedLogMessageAdapter; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.objectweb.asm.Label; diff --git a/src/main/java/net/minecraftforge/fml/AdvancedLogMessageAdapter.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java similarity index 97% rename from src/main/java/net/minecraftforge/fml/AdvancedLogMessageAdapter.java rename to src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java index e15614a48..258da5765 100644 --- a/src/main/java/net/minecraftforge/fml/AdvancedLogMessageAdapter.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/AdvancedLogMessageAdapter.java @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -package net.minecraftforge.fml; +package net.minecraftforge.fml.loading; import org.apache.logging.log4j.message.Message; import org.apache.logging.log4j.util.StringBuilderFormattable; diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java index 89a48042e..d076ca2ce 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLCommonLaunchHandler.java @@ -43,7 +43,7 @@ public abstract class FMLCommonLaunchHandler "joptsimple.", "org.lwjgl.", "com.mojang.guava.", "com.google.", "org.apache.commons.", "io.netty.", "org.apache.logging.log4j.", "org.apache.http.", "org.apache.maven.", "org.objectweb.asm.", "paulscode.sound.", "com.ibm.icu.", "sun.", "gnu.trove.", "com.electronwill.nightconfig.", - "net.minecraftforge.fml.loading.", "net.minecraftforge.fml.language.", "net.minecraftforge.versions.", + "net.minecraftforge.fml.loading.", "net.minecraftforge.fml.language.", "net.minecraftforge.eventbus.", "net.minecraftforge.api." ); diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevClientLaunchProvider.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevClientLaunchProvider.java index 42a228165..c227d8d95 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevClientLaunchProvider.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevClientLaunchProvider.java @@ -19,6 +19,7 @@ package net.minecraftforge.fml.loading; +import com.google.common.collect.ObjectArrays; import cpw.mods.modlauncher.api.IEnvironment; import cpw.mods.modlauncher.api.ILaunchHandlerService; import cpw.mods.modlauncher.api.ITransformingClassLoader; @@ -40,6 +41,7 @@ public class FMLDevClientLaunchProvider extends FMLCommonLaunchHandler implement private static final Logger LOGGER = LogManager.getLogger(); private Path compiledClasses; + private Path resources; @Override public String name() @@ -50,18 +52,21 @@ public class FMLDevClientLaunchProvider extends FMLCommonLaunchHandler implement @Override public Path[] identifyTransformationTargets() { - return LibraryFinder.commonLibPaths(new Path[] {FMLLoader.getForgePath()}); + return LibraryFinder.commonLibPaths(ObjectArrays.concat(FMLLoader.getForgePath(), FMLLoader.getMCPaths())); } + @Override public Path getForgePath(final String mcVersion, final String forgeVersion, final String forgeGroup) { // In forge dev, we just find the path for ForgeVersion for everything compiledClasses = LibraryFinder.findJarPathFor("net/minecraftforge/versions/forge/ForgeVersion.class", "forge"); + resources = LibraryFinder.findJarPathFor("assets/minecraft/lang/en_us.json", "mcassets"); return compiledClasses; } - public Path[] getMCPaths(final String mcVersion, final String forgeVersion, final String forgeGroup) { + @Override + public Path[] getMCPaths(final String mcVersion, final String mcpVersion, final String forgeVersion, final String forgeGroup) { // In forge dev, we just find the path for ForgeVersion for everything - return new Path[] { compiledClasses, compiledClasses }; + return new Path[] { compiledClasses, resources }; } @Override @@ -80,7 +85,6 @@ public class FMLDevClientLaunchProvider extends FMLCommonLaunchHandler implement @Override public void setup(IEnvironment environment, final Map arguments) { - LOGGER.debug(CORE, "No jar creation necessary. Launch is dev environment"); // we're injecting forge into the exploded dir finder final Path forgemodstoml = LibraryFinder.findJarPathFor("META-INF/mods.toml", "forgemodstoml"); ((Map>>) arguments).computeIfAbsent("explodedTargets", a->new ArrayList<>()). diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevServerLaunchProvider.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevServerLaunchProvider.java index a58cdfd25..d93ab0d68 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevServerLaunchProvider.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLDevServerLaunchProvider.java @@ -19,14 +19,18 @@ package net.minecraftforge.fml.loading; +import com.google.common.collect.ObjectArrays; import cpw.mods.modlauncher.api.IEnvironment; import cpw.mods.modlauncher.api.ILaunchHandlerService; import cpw.mods.modlauncher.api.ITransformingClassLoader; import net.minecraftforge.api.distmarker.Dist; +import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.concurrent.Callable; @@ -35,6 +39,8 @@ import static net.minecraftforge.fml.loading.LogMarkers.CORE; public class FMLDevServerLaunchProvider extends FMLCommonLaunchHandler implements ILaunchHandlerService { private static final Logger LOGGER = LogManager.getLogger(); + private Path compiledClasses; + private Path resources; @Override public String name() @@ -45,7 +51,21 @@ public class FMLDevServerLaunchProvider extends FMLCommonLaunchHandler implement @Override public Path[] identifyTransformationTargets() { - return LibraryFinder.commonLibPaths(new Path[] { FMLLoader.getForgePath() }); + return LibraryFinder.commonLibPaths(ObjectArrays.concat(FMLLoader.getForgePath(), FMLLoader.getMCPaths())); + } + + @Override + public Path getForgePath(final String mcVersion, final String forgeVersion, final String forgeGroup) { + // In forge dev, we just find the path for ForgeVersion for everything + compiledClasses = LibraryFinder.findJarPathFor("net/minecraftforge/versions/forge/ForgeVersion.class", "forge"); + resources = LibraryFinder.findJarPathFor("assets/minecraft/lang/en_us.json", "mcassets"); + return compiledClasses; + } + + @Override + public Path[] getMCPaths(final String mcVersion, final String mcpVersion, final String forgeVersion, final String forgeGroup) { + // In forge dev, we just find the path for ForgeVersion for everything + return new Path[] { compiledClasses, resources }; } @Override @@ -64,7 +84,10 @@ public class FMLDevServerLaunchProvider extends FMLCommonLaunchHandler implement @Override public void setup(IEnvironment environment, final Map arguments) { - LOGGER.debug(CORE, "No jar creation necessary. Launch is dev environment"); + // we're injecting forge into the exploded dir finder + final Path forgemodstoml = LibraryFinder.findJarPathFor("META-INF/mods.toml", "forgemodstoml"); + ((Map>>) arguments).computeIfAbsent("explodedTargets", a->new ArrayList<>()). + add(Pair.of(compiledClasses, forgemodstoml)); } @Override diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLServerLaunchProvider.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLServerLaunchProvider.java index d5e14b699..ca5e9800e 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLServerLaunchProvider.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/FMLServerLaunchProvider.java @@ -28,6 +28,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.concurrent.Callable; @@ -58,8 +60,19 @@ public class FMLServerLaunchProvider extends FMLCommonLaunchHandler implements I }; } + @SuppressWarnings("unchecked") @Override public void setup(final IEnvironment environment, final Map arguments) { + final List mavenRoots = new ArrayList<>((List) arguments.get("mavenRoots")); + final List mods = new ArrayList<>((List) arguments.get("mods")); + mavenRoots.add(LibraryFinder.findLibsPath().toString()); + final String forgeVersion = (String) arguments.get("forgeVersion"); + final String mcVersion = (String) arguments.get("mcVersion"); + final String forgeGroup = (String) arguments.get("forgeGroup"); + mods.add(forgeGroup+":forge::universal:"+mcVersion+"-"+forgeVersion); + // generics are gross yea? + ((Map)arguments).put("mavenRoots", mavenRoots); + ((Map)arguments).put("mods", mods); } @Override diff --git a/src/main/java/net/minecraftforge/server/ServerMain.java b/src/fmllauncher/java/net/minecraftforge/server/ServerMain.java similarity index 100% rename from src/main/java/net/minecraftforge/server/ServerMain.java rename to src/fmllauncher/java/net/minecraftforge/server/ServerMain.java diff --git a/src/main/resources/META-INF/defaultfmlconfig.toml b/src/fmllauncher/resources/META-INF/defaultfmlconfig.toml similarity index 100% rename from src/main/resources/META-INF/defaultfmlconfig.toml rename to src/fmllauncher/resources/META-INF/defaultfmlconfig.toml diff --git a/src/fmllauncher/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService b/src/fmllauncher/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService index 8fc5cba9c..502278a9a 100644 --- a/src/fmllauncher/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService +++ b/src/fmllauncher/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService @@ -1 +1,4 @@ net.minecraftforge.fml.loading.RuntimeDistCleaner +net.minecraftforge.common.asm.RuntimeEnumExtender +net.minecraftforge.common.asm.ObjectHolderDefinalize +net.minecraftforge.common.asm.CapabilityInjectDefinalize diff --git a/src/main/java/net/minecraftforge/common/ForgeMod.java b/src/main/java/net/minecraftforge/common/ForgeMod.java index 1c73294b8..4c51c0203 100644 --- a/src/main/java/net/minecraftforge/common/ForgeMod.java +++ b/src/main/java/net/minecraftforge/common/ForgeMod.java @@ -26,6 +26,7 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.javafmlmod.FMLModLoadingContext; import net.minecraftforge.server.command.ForgeCommand; import net.minecraftforge.versions.forge.ForgeVersion; +import net.minecraftforge.versions.mcp.MCPVersion; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -73,6 +74,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook public ForgeMod() { + LOGGER.info("Forge mod loading, version {}, for MC {} with MCP {}", ForgeVersion.getVersion(), MCPVersion.getMCVersion(), MCPVersion.getMCPVersion()); INSTANCE = this; WorldPersistenceHooks.addHook(this); WorldPersistenceHooks.addHook(new FMLWorldPersistenceHook()); @@ -82,6 +84,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook MinecraftForge.EVENT_BUS.addListener(this::serverStarting); MinecraftForge.EVENT_BUS.addListener(this::playerLogin); MinecraftForge.EVENT_BUS.addListener(this::serverStopping); + ForgeConfig.load(); } /* diff --git a/src/main/java/net/minecraftforge/fml/LaunchTesting.java b/src/main/java/net/minecraftforge/fml/LaunchTesting.java index c82fff5b8..58f0ea578 100644 --- a/src/main/java/net/minecraftforge/fml/LaunchTesting.java +++ b/src/main/java/net/minecraftforge/fml/LaunchTesting.java @@ -74,7 +74,9 @@ public class LaunchTesting "--fml.mcVersion", "1.13"); } else if (Objects.equals(target, "fmldevserver")) { String[] launchargs = ObjectArrays.concat(new String[] {"--launchTarget", target, - "--gameDir", "."}, args, String.class); + "--gameDir", ".", "--fml.forgeVersion", "24.0.0", + "--fml.mcpVersion", "2018.11.30", + "--fml.mcVersion", "1.13"}, args, String.class); Launcher.main(launchargs); } Thread.sleep(10000); diff --git a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java index d52001661..5b7b0c3ad 100644 --- a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java +++ b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLModContainer.java @@ -51,6 +51,7 @@ public class FMLModContainer extends ModContainer public FMLModContainer(IModInfo info, String className, ClassLoader modClassLoader, ModFileScanData modFileScanResults) { super(info); + LOGGER.debug("Creating FMLModContainer instance for {} with classLoader {} & {}", className, modClassLoader, getClass().getClassLoader()); this.scanResults = modFileScanResults; triggerMap.put(ModLoadingStage.CONSTRUCT, dummy().andThen(this::beforeEvent).andThen(this::constructMod).andThen(this::afterEvent)); triggerMap.put(ModLoadingStage.PREINIT, dummy().andThen(this::beforeEvent).andThen(this::preinitMod).andThen(this::fireEvent).andThen(this::afterEvent)); diff --git a/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java b/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java index 1bab67dcf..52717c3e4 100644 --- a/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java +++ b/src/main/java/net/minecraftforge/fml/relauncher/libraries/LibraryManager.java @@ -46,6 +46,7 @@ import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import net.minecraftforge.versions.mcp.MCPVersion; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -86,7 +87,7 @@ public class LibraryManager libraries_dir = Repository.get("libraries"); File mods = new File(minecraftHome, "mods"); - File mods_ver = new File(mods, ForgeVersion.mcVersion); + File mods_ver = new File(mods, MCPVersion.getMCVersion()); ModList memory = null; if (!ENABLE_AUTO_MOD_MOVEMENT) @@ -471,7 +472,7 @@ public class LibraryManager } } - for (String dir : new String[]{"mods", "mods" + File.separatorChar + ForgeVersion.mcVersion}) + for (String dir : new String[]{"mods", "mods" + File.separatorChar + MCPVersion.getMCVersion()}) { File base = new File(mcDir, dir); if (!base.isDirectory() || !base.exists()) diff --git a/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java b/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java index 6211cf60e..f07418fd4 100644 --- a/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java +++ b/src/main/java/net/minecraftforge/fml/relauncher/libraries/ModList.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; +import net.minecraftforge.versions.mcp.MCPVersion; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -66,7 +67,7 @@ public class ModList @SuppressWarnings("unchecked") public static List getKnownLists(File mcdir) { - for (String list : new String[] {"mods/mod_list.json", "mods/" + ForgeVersion.mcVersion + "/mod_list.json"/* , TODO Launch args ((Map)Launch.blackboard.get("launchArgs")).get("--modListFile")*/}) + for (String list : new String[] {"mods/mod_list.json", "mods/" + MCPVersion.getMCVersion() + "/mod_list.json"/* , TODO Launch args ((Map)Launch.blackboard.get("launchArgs")).get("--modListFile")*/}) { if (list != null) { @@ -87,7 +88,7 @@ public class ModList if (memory != null) lst.add(memory); - for (String list : new String[] {"mods/mod_list.json", "mods/" + ForgeVersion.mcVersion + "/mod_list.json"/* TODO Launch args, ((Map)Launch.blackboard.get("launchArgs")).get("--modListFile")*/}) + for (String list : new String[] {"mods/mod_list.json", "mods/" + MCPVersion.getMCVersion() + "/mod_list.json"/* TODO Launch args, ((Map)Launch.blackboard.get("launchArgs")).get("--modListFile")*/}) { if (list != null) { diff --git a/src/main/java/net/minecraftforge/versions/forge/ForgeVersion.java b/src/main/java/net/minecraftforge/versions/forge/ForgeVersion.java index 05b40e03a..3e3a988b2 100644 --- a/src/main/java/net/minecraftforge/versions/forge/ForgeVersion.java +++ b/src/main/java/net/minecraftforge/versions/forge/ForgeVersion.java @@ -20,6 +20,7 @@ package net.minecraftforge.versions.forge; import net.minecraftforge.fml.VersionChecker; +import net.minecraftforge.fml.loading.JarVersionLookupHandler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -32,30 +33,18 @@ public class ForgeVersion private static final Logger LOGGER = LogManager.getLogger(); // This is Forge's Mod Id, used for the ForgeMod and resource locations public static final String MOD_ID = "forge"; - // This is the minecraft version we're building for - used in various places in Forge/FML code - public static final String mcVersion = "1.13"; - // This is the MCP data version we're using - public static final String mcpVersion = "9.42"; private static final String forgeVersion; private static final String forgeSpec; private static final String forgeGroup; static { - String vers = ForgeVersion.class.getPackage().getImplementationVersion(); - if (vers == null) { - vers = System.getProperty("forge.version"); - } + LOGGER.debug(CORE, "Forge Version package {} from {}", ForgeVersion.class.getPackage(), ForgeVersion.class.getClassLoader()); + String vers = JarVersionLookupHandler.getImplementationVersion(ForgeVersion.class).orElse(System.getProperty("forge.version")); if (vers == null) throw new RuntimeException("Missing forge version, cannot continue"); - String spec = ForgeVersion.class.getPackage().getSpecificationVersion(); - if (spec == null) { - spec = System.getProperty("forge.spec"); - } + String spec = JarVersionLookupHandler.getSpecificationVersion(ForgeVersion.class).orElse(System.getProperty("forge.spec")); if (spec == null) throw new RuntimeException("Missing forge spec, cannot continue"); - String group = ForgeVersion.class.getPackage().getImplementationTitle(); - if (group == null) { - group = System.getProperty("forge.group"); - } + String group = JarVersionLookupHandler.getImplementationTitle(ForgeVersion.class).orElse(System.getProperty("forge.group")); if (group == null) { group = "net.minecraftforge"; // If all else fails, Our normal group } diff --git a/src/main/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService b/src/main/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService deleted file mode 100644 index 06c823ef7..000000000 --- a/src/main/resources/META-INF/services/cpw.mods.modlauncher.serviceapi.ILaunchPluginService +++ /dev/null @@ -1,3 +0,0 @@ -net.minecraftforge.common.asm.RuntimeEnumExtender -net.minecraftforge.common.asm.ObjectHolderDefinalize -net.minecraftforge.common.asm.CapabilityInjectDefinalize