diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100644 index 5595f5fe8..000000000 --- a/core/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -dependencies { - implementation(project(':loader')) - - compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") - - api("net.neoforged:bus:${eventbus_version}") - - implementation("commons-io:commons-io:${commons_io_version}") -} \ No newline at end of file diff --git a/earlydisplay/build.gradle b/earlydisplay/build.gradle index 8582a1a29..dae247b0e 100644 --- a/earlydisplay/build.gradle +++ b/earlydisplay/build.gradle @@ -15,7 +15,6 @@ switch (OperatingSystem.current()) { dependencies { implementation(project(':loader')) - implementation(project(':core')) compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") implementation("org.lwjgl:lwjgl:${lwjgl_version}") @@ -35,4 +34,4 @@ dependencies { testRuntimeOnly("org.lwjgl:lwjgl-glfw::${lwjglNatives}") testRuntimeOnly("org.lwjgl:lwjgl-opengl::${lwjglNatives}") testRuntimeOnly("org.lwjgl:lwjgl-stb::${lwjglNatives}") -} \ No newline at end of file +} diff --git a/events/build.gradle b/events/build.gradle deleted file mode 100644 index 2a2db5614..000000000 --- a/events/build.gradle +++ /dev/null @@ -1,10 +0,0 @@ -dependencies { - implementation(project(':loader')) - implementation(project(':core')) - - compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") - - api("net.neoforged:bus:${eventbus_version}") - - implementation("commons-io:commons-io:${commons_io_version}") -} \ No newline at end of file diff --git a/languages/java/build.gradle b/languages/java/build.gradle deleted file mode 100644 index e59545e8e..000000000 --- a/languages/java/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -dependencies { - compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") - - implementation(project(':loader')) - implementation(project(':core')) -} \ No newline at end of file diff --git a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java b/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java deleted file mode 100644 index e1a0c5856..000000000 --- a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.javafmlmod; - -import cpw.mods.modlauncher.api.LamdbaExceptionUtils; -import net.neoforged.fml.ModLoadingException; -import net.neoforged.fml.ModLoadingStage; -import net.neoforged.neoforgespi.language.ILifecycleEvent; -import net.neoforged.neoforgespi.language.IModLanguageProvider; -import net.neoforged.neoforgespi.language.IModInfo; -import net.neoforged.neoforgespi.language.ModFileScanData; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.objectweb.asm.Type; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collectors; - -import static net.neoforged.fml.Logging.SCAN; -import static net.neoforged.fml.Logging.LOADING; - -public class FMLJavaModLanguageProvider implements IModLanguageProvider -{ - private static final Logger LOGGER = LogManager.getLogger(); - - private static class FMLModTarget implements IModLanguageProvider.IModLanguageLoader { - private static final Logger LOGGER = FMLJavaModLanguageProvider.LOGGER; - private final String className; - private final String modId; - - private FMLModTarget(String className, String modId) - { - this.className = className; - this.modId = modId; - } - - public String getModId() - { - return modId; - } - - @SuppressWarnings("unchecked") - @Override - public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, ModuleLayer gameLayer) - { - // This language class is loaded in the system level classloader - before the game even starts - // So we must treat container construction as an arms length operation, and load the container - // in the classloader of the game - the context classloader is appropriate here. - try - { - final Class fmlContainer = Class.forName("net.neoforged.fml.javafmlmod.FMLModContainer", true, Thread.currentThread().getContextClassLoader()); - LOGGER.debug(LOADING, "Loading FMLModContainer from classloader {} - got {}", Thread.currentThread().getContextClassLoader(), fmlContainer.getClassLoader()); - final Constructor constructor = fmlContainer.getConstructor(IModInfo.class, String.class, ModFileScanData.class, ModuleLayer.class); - return (T)constructor.newInstance(info, className, modFileScanResults, gameLayer); - } - catch (InvocationTargetException e) { - LOGGER.fatal(LOADING, "Failed to build mod", e); - if (e.getTargetException() instanceof ModLoadingException mle) { - throw mle; - } else { - throw new ModLoadingException(info, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadmodclass", e); - } - } - catch (NoSuchMethodException | ClassNotFoundException | InstantiationException | IllegalAccessException e) - { - LOGGER.fatal(LOADING,"Unable to load FMLModContainer, wut?", e); - final Class mle = (Class)LamdbaExceptionUtils.uncheck(()->Class.forName("net.neoforged.fml.ModLoadingException", true, Thread.currentThread().getContextClassLoader())); - final Class mls = (Class) LamdbaExceptionUtils.uncheck(()->Class.forName("net.neoforged.fml.ModLoadingStage", true, Thread.currentThread().getContextClassLoader())); - throw LamdbaExceptionUtils.uncheck(()->LamdbaExceptionUtils.uncheck(()->mle.getConstructor(IModInfo.class, mls, String.class, Throwable.class)).newInstance(info, Enum.valueOf(mls, "CONSTRUCT"), "fml.modloading.failedtoloadmodclass", e)); - } - } - } - - public static final Type MODANNOTATION = Type.getType("Lnet/neoforged/fml/common/Mod;"); - - @Override - public String name() - { - return "javafml"; - } - - @Override - public Consumer getFileVisitor() { - return scanResult -> { - final Map modTargetMap = scanResult.getAnnotations().stream() - .filter(ad -> ad.annotationType().equals(MODANNOTATION)) - .peek(ad -> LOGGER.debug(SCAN, "Found @Mod class {} with id {}", ad.clazz().getClassName(), ad.annotationData().get("value"))) - .map(ad -> new FMLModTarget(ad.clazz().getClassName(), (String)ad.annotationData().get("value"))) - .collect(Collectors.toMap(FMLModTarget::getModId, Function.identity(), (a,b)->a)); - scanResult.addLanguageLoader(modTargetMap); - }; - } - - @Override - public > void consumeLifecycleEvent(final Supplier consumeEvent) { - - } -} diff --git a/languages/java/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider b/languages/java/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider deleted file mode 100644 index 7def367f8..000000000 --- a/languages/java/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider +++ /dev/null @@ -1 +0,0 @@ -net.neoforged.fml.javafmlmod.FMLJavaModLanguageProvider diff --git a/languages/lowcode/build.gradle b/languages/lowcode/build.gradle deleted file mode 100644 index e59545e8e..000000000 --- a/languages/lowcode/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -dependencies { - compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") - - implementation(project(':loader')) - implementation(project(':core')) -} \ No newline at end of file diff --git a/languages/lowcode/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java b/languages/lowcode/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java deleted file mode 100644 index b9e70b6b3..000000000 --- a/languages/lowcode/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.lowcodemod; - -import cpw.mods.modlauncher.api.LamdbaExceptionUtils; -import net.neoforged.fml.ModLoadingException; -import net.neoforged.fml.ModLoadingStage; -import net.neoforged.neoforgespi.language.ILifecycleEvent; -import net.neoforged.neoforgespi.language.IModLanguageProvider; -import net.neoforged.neoforgespi.language.IModInfo; -import net.neoforged.neoforgespi.language.ModFileScanData; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; -import java.util.stream.Collectors; - -import static net.neoforged.fml.Logging.LOADING; - -public class LowCodeModLanguageProvider implements IModLanguageProvider -{ - private record LowCodeModTarget(String modId) implements IModLanguageProvider.IModLanguageLoader - { - private static final Logger LOGGER = LogManager.getLogger(); - - @SuppressWarnings("unchecked") - @Override - public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, ModuleLayer gameLayer) - { - // This language class is loaded in the system level classloader - before the game even starts - // So we must treat container construction as an arms length operation, and load the container - // in the classloader of the game - the context classloader is appropriate here. - try { - final Class fmlContainer = Class.forName("net.neoforged.fml.lowcodemod.LowCodeModContainer", true, Thread.currentThread().getContextClassLoader()); - LOGGER.debug(LOADING, "Loading LowCodeModContainer from classloader {} - got {}", Thread.currentThread().getContextClassLoader(), fmlContainer.getClassLoader()); - final Constructor constructor = fmlContainer.getConstructor(IModInfo.class, ModFileScanData.class, ModuleLayer.class); - return (T) constructor.newInstance(info, modFileScanResults, gameLayer); - } catch (InvocationTargetException e) { - LOGGER.fatal(LOADING, "Failed to build mod", e); - if (e.getTargetException() instanceof ModLoadingException mle) { - throw mle; - } else { - throw new ModLoadingException(info, ModLoadingStage.CONSTRUCT, "fml.modloading.failedtoloadmodclass", e); - } - } catch (NoSuchMethodException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { - LOGGER.fatal(LOADING, "Unable to load LowCodeModContainer, wut?", e); - final Class mle = (Class) LamdbaExceptionUtils.uncheck(() -> Class.forName("net.neoforged.fml.ModLoadingException", true, Thread.currentThread().getContextClassLoader())); - final Class mls = (Class) LamdbaExceptionUtils.uncheck(() -> Class.forName("net.neoforged.fml.ModLoadingStage", true, Thread.currentThread().getContextClassLoader())); - throw LamdbaExceptionUtils.uncheck(() -> LamdbaExceptionUtils.uncheck(() -> mle.getConstructor(IModInfo.class, mls, String.class, Throwable.class)).newInstance(info, Enum.valueOf(mls, "CONSTRUCT"), "fml.modloading.failedtoloadmodclass", e)); - } - } - } - - @Override - public String name() - { - return "lowcodefml"; - } - - @Override - public Consumer getFileVisitor() - { - return scanResult -> - { - final Map modTargetMap = scanResult.getIModInfoData().stream() - .flatMap(fi->fi.getMods().stream()) - .map(IModInfo::getModId) - .map(LowCodeModTarget::new) - .collect(Collectors.toMap(LowCodeModTarget::modId, Function.identity(), (a, b)->a)); - scanResult.addLanguageLoader(modTargetMap); - }; - } - - @Override - public > void consumeLifecycleEvent(final Supplier consumeEvent) - { - } -} diff --git a/languages/lowcode/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider b/languages/lowcode/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider deleted file mode 100644 index b1ea5908b..000000000 --- a/languages/lowcode/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider +++ /dev/null @@ -1 +0,0 @@ -net.neoforged.fml.lowcodemod.LowCodeModLanguageProvider diff --git a/languages/minecraft/build.gradle b/languages/minecraft/build.gradle deleted file mode 100644 index b145f34e1..000000000 --- a/languages/minecraft/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -dependencies { - compileOnly("org.jetbrains:annotations:${jetbrains_annotations_version}") - implementation(project(':loader')) - implementation(project(':core')) -} \ No newline at end of file diff --git a/languages/minecraft/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java b/languages/minecraft/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java deleted file mode 100644 index 824700395..000000000 --- a/languages/minecraft/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Forge Development LLC and contributors - * SPDX-License-Identifier: LGPL-2.1-only - */ - -package net.neoforged.fml.mclanguageprovider; - -import net.neoforged.neoforgespi.language.ILifecycleEvent; -import net.neoforged.neoforgespi.language.IModInfo; -import net.neoforged.neoforgespi.language.IModLanguageProvider; -import net.neoforged.neoforgespi.language.ModFileScanData; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.lang.reflect.InvocationTargetException; -import java.util.Map; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import static net.neoforged.fml.Logging.LOADING; - -public class MinecraftModLanguageProvider implements IModLanguageProvider { - private static final Logger LOGGER = LogManager.getLogger(); - @Override - public String name() { - return "minecraft"; - } - - @Override - public Consumer getFileVisitor() { - return (sd)->sd.addLanguageLoader(Map.of("minecraft", new MinecraftModTarget())); - } - - @Override - public > void consumeLifecycleEvent(final Supplier consumeEvent) { - - } - - public static class MinecraftModTarget implements IModLanguageLoader { - @SuppressWarnings("unchecked") - @Override - public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, final ModuleLayer gameLayer) { - try { - var module = gameLayer.findModule("minecraft").orElseThrow(); - final Class mcModClass = Class.forName(getClass().getModule(), "net.neoforged.fml.mclanguageprovider.MinecraftModContainer"); - return (T)mcModClass.getConstructor(IModInfo.class).newInstance(info); - } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { - LOGGER.fatal(LOADING,"Unable to load MinecraftModContainer, wut?", e); - throw new RuntimeException(e); - } - } - } -} diff --git a/languages/minecraft/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider b/languages/minecraft/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider deleted file mode 100644 index e3b88effe..000000000 --- a/languages/minecraft/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider +++ /dev/null @@ -1 +0,0 @@ -net.neoforged.fml.mclanguageprovider.MinecraftModLanguageProvider diff --git a/loader/build.gradle b/loader/build.gradle index ace9f37d8..99bfc71cb 100644 --- a/loader/build.gradle +++ b/loader/build.gradle @@ -19,6 +19,7 @@ dependencies { api("com.mojang:logging:${mojang_logging_version}") api "net.neoforged:JarJarSelector:${jarjar_version}" api "net.neoforged:JarJarMetadata:${jarjar_version}" + api("net.neoforged:bus:${eventbus_version}") implementation("net.sf.jopt-simple:jopt-simple:${jopt_simple_version}") implementation("cpw.mods:securejarhandler:${securejarhandler_version}") @@ -28,6 +29,7 @@ dependencies { } implementation("org.spongepowered:mixin:${mixin_version}") implementation("net.minecrell:terminalconsoleappender:${terminalconsoleappender_version}") + implementation("commons-io:commons-io:${commons_io_version}") implementation("org.apache.logging.log4j:log4j-core:${log4j_version}") annotationProcessor("org.apache.logging.log4j:log4j-core:${log4j_version}") diff --git a/core/src/main/java/net/neoforged/fml/Bindings.java b/loader/src/main/java/net/neoforged/fml/Bindings.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/Bindings.java rename to loader/src/main/java/net/neoforged/fml/Bindings.java diff --git a/core/src/main/java/net/neoforged/fml/CrashReportCallables.java b/loader/src/main/java/net/neoforged/fml/CrashReportCallables.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/CrashReportCallables.java rename to loader/src/main/java/net/neoforged/fml/CrashReportCallables.java diff --git a/core/src/main/java/net/neoforged/fml/DeferredWorkQueue.java b/loader/src/main/java/net/neoforged/fml/DeferredWorkQueue.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/DeferredWorkQueue.java rename to loader/src/main/java/net/neoforged/fml/DeferredWorkQueue.java diff --git a/core/src/main/java/net/neoforged/fml/DistExecutor.java b/loader/src/main/java/net/neoforged/fml/DistExecutor.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/DistExecutor.java rename to loader/src/main/java/net/neoforged/fml/DistExecutor.java diff --git a/core/src/main/java/net/neoforged/fml/I18NParser.java b/loader/src/main/java/net/neoforged/fml/I18NParser.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/I18NParser.java rename to loader/src/main/java/net/neoforged/fml/I18NParser.java diff --git a/core/src/main/java/net/neoforged/fml/IBindingsProvider.java b/loader/src/main/java/net/neoforged/fml/IBindingsProvider.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/IBindingsProvider.java rename to loader/src/main/java/net/neoforged/fml/IBindingsProvider.java diff --git a/core/src/main/java/net/neoforged/fml/ICrashCallable.java b/loader/src/main/java/net/neoforged/fml/ICrashCallable.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ICrashCallable.java rename to loader/src/main/java/net/neoforged/fml/ICrashCallable.java diff --git a/core/src/main/java/net/neoforged/fml/IExtensionPoint.java b/loader/src/main/java/net/neoforged/fml/IExtensionPoint.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/IExtensionPoint.java rename to loader/src/main/java/net/neoforged/fml/IExtensionPoint.java diff --git a/core/src/main/java/net/neoforged/fml/IModLoadingState.java b/loader/src/main/java/net/neoforged/fml/IModLoadingState.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/IModLoadingState.java rename to loader/src/main/java/net/neoforged/fml/IModLoadingState.java diff --git a/core/src/main/java/net/neoforged/fml/IModStateProvider.java b/loader/src/main/java/net/neoforged/fml/IModStateProvider.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/IModStateProvider.java rename to loader/src/main/java/net/neoforged/fml/IModStateProvider.java diff --git a/core/src/main/java/net/neoforged/fml/IModStateTransition.java b/loader/src/main/java/net/neoforged/fml/IModStateTransition.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/IModStateTransition.java rename to loader/src/main/java/net/neoforged/fml/IModStateTransition.java diff --git a/core/src/main/java/net/neoforged/fml/ISystemReportExtender.java b/loader/src/main/java/net/neoforged/fml/ISystemReportExtender.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ISystemReportExtender.java rename to loader/src/main/java/net/neoforged/fml/ISystemReportExtender.java diff --git a/core/src/main/java/net/neoforged/fml/InterModComms.java b/loader/src/main/java/net/neoforged/fml/InterModComms.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/InterModComms.java rename to loader/src/main/java/net/neoforged/fml/InterModComms.java diff --git a/core/src/main/java/net/neoforged/fml/LoadingFailedException.java b/loader/src/main/java/net/neoforged/fml/LoadingFailedException.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/LoadingFailedException.java rename to loader/src/main/java/net/neoforged/fml/LoadingFailedException.java diff --git a/core/src/main/java/net/neoforged/fml/Logging.java b/loader/src/main/java/net/neoforged/fml/Logging.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/Logging.java rename to loader/src/main/java/net/neoforged/fml/Logging.java diff --git a/core/src/main/java/net/neoforged/fml/LogicalSide.java b/loader/src/main/java/net/neoforged/fml/LogicalSide.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/LogicalSide.java rename to loader/src/main/java/net/neoforged/fml/LogicalSide.java diff --git a/core/src/main/java/net/neoforged/fml/ModContainer.java b/loader/src/main/java/net/neoforged/fml/ModContainer.java similarity index 99% rename from core/src/main/java/net/neoforged/fml/ModContainer.java rename to loader/src/main/java/net/neoforged/fml/ModContainer.java index d2d497c21..fddbde09f 100644 --- a/core/src/main/java/net/neoforged/fml/ModContainer.java +++ b/loader/src/main/java/net/neoforged/fml/ModContainer.java @@ -26,7 +26,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.function.BiFunction; -import java.util.function.Consumer; import java.util.function.Supplier; import static net.neoforged.fml.Logging.LOADING; diff --git a/core/src/main/java/net/neoforged/fml/ModList.java b/loader/src/main/java/net/neoforged/fml/ModList.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModList.java rename to loader/src/main/java/net/neoforged/fml/ModList.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoader.java b/loader/src/main/java/net/neoforged/fml/ModLoader.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoader.java rename to loader/src/main/java/net/neoforged/fml/ModLoader.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingContext.java b/loader/src/main/java/net/neoforged/fml/ModLoadingContext.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingContext.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingContext.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingException.java b/loader/src/main/java/net/neoforged/fml/ModLoadingException.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingException.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingException.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingPhase.java b/loader/src/main/java/net/neoforged/fml/ModLoadingPhase.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingPhase.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingPhase.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingStage.java b/loader/src/main/java/net/neoforged/fml/ModLoadingStage.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingStage.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingStage.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingState.java b/loader/src/main/java/net/neoforged/fml/ModLoadingState.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingState.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingState.java diff --git a/core/src/main/java/net/neoforged/fml/ModLoadingWarning.java b/loader/src/main/java/net/neoforged/fml/ModLoadingWarning.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModLoadingWarning.java rename to loader/src/main/java/net/neoforged/fml/ModLoadingWarning.java diff --git a/core/src/main/java/net/neoforged/fml/ModStateManager.java b/loader/src/main/java/net/neoforged/fml/ModStateManager.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModStateManager.java rename to loader/src/main/java/net/neoforged/fml/ModStateManager.java diff --git a/core/src/main/java/net/neoforged/fml/ModWorkManager.java b/loader/src/main/java/net/neoforged/fml/ModWorkManager.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ModWorkManager.java rename to loader/src/main/java/net/neoforged/fml/ModWorkManager.java diff --git a/core/src/main/java/net/neoforged/fml/OptionalMod.java b/loader/src/main/java/net/neoforged/fml/OptionalMod.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/OptionalMod.java rename to loader/src/main/java/net/neoforged/fml/OptionalMod.java diff --git a/core/src/main/java/net/neoforged/fml/StartupMessageManager.java b/loader/src/main/java/net/neoforged/fml/StartupMessageManager.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/StartupMessageManager.java rename to loader/src/main/java/net/neoforged/fml/StartupMessageManager.java diff --git a/core/src/main/java/net/neoforged/fml/ThreadSelector.java b/loader/src/main/java/net/neoforged/fml/ThreadSelector.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/ThreadSelector.java rename to loader/src/main/java/net/neoforged/fml/ThreadSelector.java diff --git a/core/src/main/java/net/neoforged/fml/VersionChecker.java b/loader/src/main/java/net/neoforged/fml/VersionChecker.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/VersionChecker.java rename to loader/src/main/java/net/neoforged/fml/VersionChecker.java diff --git a/languages/java/src/main/java/net/neoforged/fml/common/Mod.java b/loader/src/main/java/net/neoforged/fml/common/Mod.java similarity index 100% rename from languages/java/src/main/java/net/neoforged/fml/common/Mod.java rename to loader/src/main/java/net/neoforged/fml/common/Mod.java diff --git a/core/src/main/java/net/neoforged/fml/config/ConfigFileTypeHandler.java b/loader/src/main/java/net/neoforged/fml/config/ConfigFileTypeHandler.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/config/ConfigFileTypeHandler.java rename to loader/src/main/java/net/neoforged/fml/config/ConfigFileTypeHandler.java diff --git a/core/src/main/java/net/neoforged/fml/config/ConfigTracker.java b/loader/src/main/java/net/neoforged/fml/config/ConfigTracker.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/config/ConfigTracker.java rename to loader/src/main/java/net/neoforged/fml/config/ConfigTracker.java diff --git a/core/src/main/java/net/neoforged/fml/config/IConfigEvent.java b/loader/src/main/java/net/neoforged/fml/config/IConfigEvent.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/config/IConfigEvent.java rename to loader/src/main/java/net/neoforged/fml/config/IConfigEvent.java diff --git a/core/src/main/java/net/neoforged/fml/config/IConfigSpec.java b/loader/src/main/java/net/neoforged/fml/config/IConfigSpec.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/config/IConfigSpec.java rename to loader/src/main/java/net/neoforged/fml/config/IConfigSpec.java diff --git a/core/src/main/java/net/neoforged/fml/config/ModConfig.java b/loader/src/main/java/net/neoforged/fml/config/ModConfig.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/config/ModConfig.java rename to loader/src/main/java/net/neoforged/fml/config/ModConfig.java diff --git a/events/src/main/java/net/neoforged/fml/core/ModStateProvider.java b/loader/src/main/java/net/neoforged/fml/core/ModStateProvider.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/core/ModStateProvider.java rename to loader/src/main/java/net/neoforged/fml/core/ModStateProvider.java diff --git a/events/src/main/java/net/neoforged/fml/core/ParallelTransition.java b/loader/src/main/java/net/neoforged/fml/core/ParallelTransition.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/core/ParallelTransition.java rename to loader/src/main/java/net/neoforged/fml/core/ParallelTransition.java diff --git a/core/src/main/java/net/neoforged/fml/event/IModBusEvent.java b/loader/src/main/java/net/neoforged/fml/event/IModBusEvent.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/event/IModBusEvent.java rename to loader/src/main/java/net/neoforged/fml/event/IModBusEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/config/ModConfigEvent.java b/loader/src/main/java/net/neoforged/fml/event/config/ModConfigEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/config/ModConfigEvent.java rename to loader/src/main/java/net/neoforged/fml/event/config/ModConfigEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/FMLClientSetupEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLClientSetupEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/FMLClientSetupEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLClientSetupEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/FMLCommonSetupEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLCommonSetupEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/FMLCommonSetupEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLCommonSetupEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/FMLConstructModEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLConstructModEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/FMLConstructModEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLConstructModEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/FMLDedicatedServerSetupEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLDedicatedServerSetupEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/FMLDedicatedServerSetupEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLDedicatedServerSetupEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/FMLLoadCompleteEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLLoadCompleteEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/FMLLoadCompleteEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/FMLLoadCompleteEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/InterModEnqueueEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/InterModEnqueueEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/InterModEnqueueEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/InterModEnqueueEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/InterModProcessEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/InterModProcessEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/InterModProcessEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/InterModProcessEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/ModLifecycleEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/ModLifecycleEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/ModLifecycleEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/ModLifecycleEvent.java diff --git a/events/src/main/java/net/neoforged/fml/event/lifecycle/ParallelDispatchEvent.java b/loader/src/main/java/net/neoforged/fml/event/lifecycle/ParallelDispatchEvent.java similarity index 100% rename from events/src/main/java/net/neoforged/fml/event/lifecycle/ParallelDispatchEvent.java rename to loader/src/main/java/net/neoforged/fml/event/lifecycle/ParallelDispatchEvent.java diff --git a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/AutomaticEventSubscriber.java b/loader/src/main/java/net/neoforged/fml/javafmlmod/AutomaticEventSubscriber.java similarity index 100% rename from languages/java/src/main/java/net/neoforged/fml/javafmlmod/AutomaticEventSubscriber.java rename to loader/src/main/java/net/neoforged/fml/javafmlmod/AutomaticEventSubscriber.java diff --git a/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java b/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java new file mode 100644 index 000000000..4efd458f1 --- /dev/null +++ b/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLanguageProvider.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ + +package net.neoforged.fml.javafmlmod; + +import net.neoforged.neoforgespi.language.IModLanguageProvider; +import net.neoforged.neoforgespi.language.IModInfo; +import net.neoforged.neoforgespi.language.ModFileScanData; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.objectweb.asm.Type; + +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import static net.neoforged.fml.Logging.SCAN; + +public class FMLJavaModLanguageProvider implements IModLanguageProvider +{ + private static final Logger LOGGER = LogManager.getLogger(); + + private static class FMLModTarget implements IModLanguageProvider.IModLanguageLoader { + private static final Logger LOGGER = FMLJavaModLanguageProvider.LOGGER; + private final String className; + private final String modId; + + private FMLModTarget(String className, String modId) + { + this.className = className; + this.modId = modId; + } + + public String getModId() + { + return modId; + } + + @SuppressWarnings("unchecked") + @Override + public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, ModuleLayer gameLayer) + { + return (T) new FMLModContainer(info, className, modFileScanResults, gameLayer); + } + } + + public static final Type MODANNOTATION = Type.getType("Lnet/neoforged/fml/common/Mod;"); + + @Override + public String name() + { + return "javafml"; + } + + @Override + public Consumer getFileVisitor() { + return scanResult -> { + final Map modTargetMap = scanResult.getAnnotations().stream() + .filter(ad -> ad.annotationType().equals(MODANNOTATION)) + .peek(ad -> LOGGER.debug(SCAN, "Found @Mod class {} with id {}", ad.clazz().getClassName(), ad.annotationData().get("value"))) + .map(ad -> new FMLModTarget(ad.clazz().getClassName(), (String)ad.annotationData().get("value"))) + .collect(Collectors.toMap(FMLModTarget::getModId, Function.identity(), (a,b)->a)); + scanResult.addLanguageLoader(modTargetMap); + }; + } +} diff --git a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLoadingContext.java b/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLoadingContext.java similarity index 100% rename from languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLoadingContext.java rename to loader/src/main/java/net/neoforged/fml/javafmlmod/FMLJavaModLoadingContext.java diff --git a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java b/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java similarity index 99% rename from languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java rename to loader/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java index e0f40c7c2..5830fc710 100644 --- a/languages/java/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java +++ b/loader/src/main/java/net/neoforged/fml/javafmlmod/FMLModContainer.java @@ -26,7 +26,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashSet; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; diff --git a/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModValidator.java b/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModValidator.java index 91b52eb79..6309a9929 100644 --- a/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModValidator.java +++ b/loader/src/main/java/net/neoforged/fml/loading/moddiscovery/ModValidator.java @@ -12,6 +12,7 @@ import net.neoforged.neoforgespi.language.IModFileInfo; import net.neoforged.neoforgespi.locating.IModFile; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import java.util.ArrayList; @@ -40,7 +41,7 @@ public ModValidator(final Map> modFiles, final List this.brokenFiles = brokenFiles.stream().map(IModFileInfo::getFile).collect(Collectors.toList()); // mutable list } - private static List lst(List files) { + private static List lst(@Nullable List files) { return files == null ? new ArrayList<>() : new ArrayList<>(files); } @@ -76,7 +77,7 @@ public ITransformationService.Resource getModResources() { // mods this.loadingModList.getModFiles().stream().map(ModFileInfo::getFile), // game libraries - this.modFiles.get(IModFile.Type.GAMELIBRARY).stream()); + lst(this.modFiles.get(IModFile.Type.GAMELIBRARY)).stream()); return new ITransformationService.Resource(IModuleLayerManager.Layer.GAME, modFilesToLoad.map(ModFile::getSecureJar).toList()); } diff --git a/languages/lowcode/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModContainer.java b/loader/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModContainer.java similarity index 100% rename from languages/lowcode/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModContainer.java rename to loader/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModContainer.java diff --git a/loader/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java b/loader/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java new file mode 100644 index 000000000..1c9353c45 --- /dev/null +++ b/loader/src/main/java/net/neoforged/fml/lowcodemod/LowCodeModLanguageProvider.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ + +package net.neoforged.fml.lowcodemod; + +import net.neoforged.neoforgespi.language.IModLanguageProvider; +import net.neoforged.neoforgespi.language.IModInfo; +import net.neoforged.neoforgespi.language.ModFileScanData; + +import java.util.Map; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +public class LowCodeModLanguageProvider implements IModLanguageProvider +{ + private record LowCodeModTarget(String modId) implements IModLanguageProvider.IModLanguageLoader + { + @SuppressWarnings("unchecked") + @Override + public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, ModuleLayer gameLayer) + { + return (T) new LowCodeModContainer(info, modFileScanResults, gameLayer); + } + } + + @Override + public String name() + { + return "lowcodefml"; + } + + @Override + public Consumer getFileVisitor() + { + return scanResult -> + { + final Map modTargetMap = scanResult.getIModInfoData().stream() + .flatMap(fi->fi.getMods().stream()) + .map(IModInfo::getModId) + .map(LowCodeModTarget::new) + .collect(Collectors.toMap(LowCodeModTarget::modId, Function.identity(), (a, b)->a)); + scanResult.addLanguageLoader(modTargetMap); + }; + } +} diff --git a/languages/minecraft/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModContainer.java b/loader/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModContainer.java similarity index 100% rename from languages/minecraft/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModContainer.java rename to loader/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModContainer.java diff --git a/loader/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java b/loader/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java new file mode 100644 index 000000000..f691e96ee --- /dev/null +++ b/loader/src/main/java/net/neoforged/fml/mclanguageprovider/MinecraftModLanguageProvider.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) Forge Development LLC and contributors + * SPDX-License-Identifier: LGPL-2.1-only + */ + +package net.neoforged.fml.mclanguageprovider; + +import net.neoforged.neoforgespi.language.IModInfo; +import net.neoforged.neoforgespi.language.IModLanguageProvider; +import net.neoforged.neoforgespi.language.ModFileScanData; + +import java.util.Map; +import java.util.function.Consumer; + +public class MinecraftModLanguageProvider implements IModLanguageProvider { + @Override + public String name() { + return "minecraft"; + } + + @Override + public Consumer getFileVisitor() { + return (sd)->sd.addLanguageLoader(Map.of("minecraft", new MinecraftModTarget())); + } + + public static class MinecraftModTarget implements IModLanguageLoader { + @SuppressWarnings("unchecked") + @Override + public T loadMod(final IModInfo info, final ModFileScanData modFileScanResults, final ModuleLayer gameLayer) { + return (T) new MinecraftModContainer(info); + } + } +} diff --git a/core/src/main/java/net/neoforged/fml/util/CertificateHelper.java b/loader/src/main/java/net/neoforged/fml/util/CertificateHelper.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/CertificateHelper.java rename to loader/src/main/java/net/neoforged/fml/util/CertificateHelper.java diff --git a/core/src/main/java/net/neoforged/fml/util/EnhancedRuntimeException.java b/loader/src/main/java/net/neoforged/fml/util/EnhancedRuntimeException.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/EnhancedRuntimeException.java rename to loader/src/main/java/net/neoforged/fml/util/EnhancedRuntimeException.java diff --git a/core/src/main/java/net/neoforged/fml/util/LoaderException.java b/loader/src/main/java/net/neoforged/fml/util/LoaderException.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/LoaderException.java rename to loader/src/main/java/net/neoforged/fml/util/LoaderException.java diff --git a/core/src/main/java/net/neoforged/fml/util/LoaderExceptionModCrash.java b/loader/src/main/java/net/neoforged/fml/util/LoaderExceptionModCrash.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/LoaderExceptionModCrash.java rename to loader/src/main/java/net/neoforged/fml/util/LoaderExceptionModCrash.java diff --git a/core/src/main/java/net/neoforged/fml/util/ObfuscationReflectionHelper.java b/loader/src/main/java/net/neoforged/fml/util/ObfuscationReflectionHelper.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/ObfuscationReflectionHelper.java rename to loader/src/main/java/net/neoforged/fml/util/ObfuscationReflectionHelper.java diff --git a/core/src/main/java/net/neoforged/fml/util/thread/EffectiveSide.java b/loader/src/main/java/net/neoforged/fml/util/thread/EffectiveSide.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/thread/EffectiveSide.java rename to loader/src/main/java/net/neoforged/fml/util/thread/EffectiveSide.java diff --git a/core/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroup.java b/loader/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroup.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroup.java rename to loader/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroup.java diff --git a/core/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroups.java b/loader/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroups.java similarity index 100% rename from core/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroups.java rename to loader/src/main/java/net/neoforged/fml/util/thread/SidedThreadGroups.java diff --git a/events/src/main/resources/META-INF/services/net.neoforged.fml.IModStateProvider b/loader/src/main/resources/META-INF/services/net.neoforged.fml.IModStateProvider similarity index 100% rename from events/src/main/resources/META-INF/services/net.neoforged.fml.IModStateProvider rename to loader/src/main/resources/META-INF/services/net.neoforged.fml.IModStateProvider diff --git a/loader/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider b/loader/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider new file mode 100644 index 000000000..da784e674 --- /dev/null +++ b/loader/src/main/resources/META-INF/services/net.neoforged.neoforgespi.language.IModLanguageProvider @@ -0,0 +1,3 @@ +net.neoforged.fml.javafmlmod.FMLJavaModLanguageProvider +net.neoforged.fml.lowcodemod.LowCodeModLanguageProvider +net.neoforged.fml.mclanguageprovider.MinecraftModLanguageProvider diff --git a/settings.gradle b/settings.gradle index 478b10720..66d6ab09e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -20,19 +20,8 @@ plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' } -ext.includeLanguage = { name -> - include "language-$name" - project(":language-$name").projectDir = file("languages/$name") -} - rootProject.name = 'FancyModLoader' include 'loader' -include 'core' -include 'events' include 'earlydisplay' include 'spi' - -includeLanguage 'minecraft' -includeLanguage 'java' -includeLanguage 'lowcode' \ No newline at end of file diff --git a/spi/src/main/java/net/neoforged/neoforgespi/language/ILifecycleEvent.java b/spi/src/main/java/net/neoforged/neoforgespi/language/ILifecycleEvent.java index 9aa854ea6..52a5e111d 100644 --- a/spi/src/main/java/net/neoforged/neoforgespi/language/ILifecycleEvent.java +++ b/spi/src/main/java/net/neoforged/neoforgespi/language/ILifecycleEvent.java @@ -5,6 +5,7 @@ package net.neoforged.neoforgespi.language; +@Deprecated(forRemoval = true, since = "2.0.8") public interface ILifecycleEvent> { @SuppressWarnings("unchecked") default R concrete() { diff --git a/spi/src/main/java/net/neoforged/neoforgespi/language/IModLanguageProvider.java b/spi/src/main/java/net/neoforged/neoforgespi/language/IModLanguageProvider.java index c5ee9e5e7..23701b77e 100644 --- a/spi/src/main/java/net/neoforged/neoforgespi/language/IModLanguageProvider.java +++ b/spi/src/main/java/net/neoforged/neoforgespi/language/IModLanguageProvider.java @@ -34,7 +34,12 @@ public interface IModLanguageProvider Consumer getFileVisitor(); - > void consumeLifecycleEvent(Supplier consumeEvent); + /** + * @deprecated Does not do anything. + */ + @Deprecated(forRemoval = true, since = "2.0.8") + default > void consumeLifecycleEvent(Supplier consumeEvent) { + } interface IModLanguageLoader { T loadMod(IModInfo info, ModFileScanData modFileScanResults, ModuleLayer layer);