Skip to content

Commit

Permalink
Fix discovery of FML services from mods folder in ML (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte authored May 9, 2024
1 parent fde6bfa commit e97e762
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
import cpw.mods.jarhandling.JarMetadata;
import cpw.mods.jarhandling.SecureJar;
import cpw.mods.modlauncher.api.IModuleLayerManager.Layer;
import cpw.mods.modlauncher.api.ITransformationService;
import cpw.mods.modlauncher.serviceapi.ITransformerDiscoveryService;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Set;
import net.neoforged.neoforgespi.earlywindow.GraphicsBootstrapper;
import net.neoforged.neoforgespi.locating.IDependencyLocator;
import net.neoforged.neoforgespi.locating.IModFileCandidateLocator;
import net.neoforged.neoforgespi.locating.IModFileReader;

/**
* Defines a class containing constants which implementations of {@link ITransformerDiscoveryService}
Expand All @@ -26,12 +31,13 @@ private TransformerDiscovererConstants() {}
* {@link Layer#SERVICE} module layer.
*/
public static final Set<String> SERVICES = Set.of(
"cpw.mods.modlauncher.api.ITransformationService",
"net.neoforged.neoforgespi.locating.IModLocator",
"net.neoforged.neoforgespi.locating.IDependencyLocator",
"net.neoforged.neoforgespi.earlywindow.GraphicsBootstrapper",
"net.neoforged.fml.loading.ImmediateWindowProvider", // FIXME: remove this when removing the legacy ImmediateWindowProvider
"net.neoforged.neoforgespi.earlywindow.ImmediateWindowProvider");
ITransformationService.class.getName(),
IModFileCandidateLocator.class.getName(),
IModFileReader.class.getName(),
IDependencyLocator.class.getName(),
GraphicsBootstrapper.class.getName(),
ImmediateWindowProvider.class.getName(), // FIXME: remove this when removing the legacy ImmediateWindowProvider
net.neoforged.neoforgespi.earlywindow.ImmediateWindowProvider.class.getName());

public static boolean shouldLoadInServiceLayer(Collection<Path> paths) {
return shouldLoadInServiceLayer(JarContents.of(paths));
Expand Down

0 comments on commit e97e762

Please sign in to comment.