Fix exclusion of coremods not filtering correctly when the mods directory is a symbolic link. (#6600)
This commit is contained in:
parent
8084cc5499
commit
4ce32c3663
|
@ -53,7 +53,7 @@ public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void scan(final Path gameDirectory) {
|
private static void scan(final Path gameDirectory) {
|
||||||
final Path modsDir = gameDirectory.resolve(FMLPaths.MODSDIR.relative());
|
final Path modsDir = gameDirectory.resolve(FMLPaths.MODSDIR.relative()).toAbsolutePath().normalize();
|
||||||
transformers = new ArrayList<>();
|
transformers = new ArrayList<>();
|
||||||
locators = new ArrayList<>();
|
locators = new ArrayList<>();
|
||||||
if (!Files.exists(modsDir)) {
|
if (!Files.exists(modsDir)) {
|
||||||
|
@ -74,9 +74,9 @@ public class ModDirTransformerDiscoverer implements ITransformerDiscoveryService
|
||||||
if (LamdbaExceptionUtils.uncheck(() -> Files.size(path)) == 0) return;
|
if (LamdbaExceptionUtils.uncheck(() -> Files.size(path)) == 0) return;
|
||||||
try (ZipFile zf = new ZipFile(new File(path.toUri()))) {
|
try (ZipFile zf = new ZipFile(new File(path.toUri()))) {
|
||||||
if (zf.getEntry("META-INF/services/cpw.mods.modlauncher.api.ITransformationService") != null) {
|
if (zf.getEntry("META-INF/services/cpw.mods.modlauncher.api.ITransformationService") != null) {
|
||||||
transformers.add(path.toRealPath());
|
transformers.add(path);
|
||||||
} else if (zf.getEntry("META-INF/services/net.minecraftforge.forgespi.locating.IModLocator") != null) {
|
} else if (zf.getEntry("META-INF/services/net.minecraftforge.forgespi.locating.IModLocator") != null) {
|
||||||
locators.add(path.toRealPath());
|
locators.add(path);
|
||||||
}
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
LogManager.getLogger().error("Zip Error when loading jar file {}", path, ioe);
|
LogManager.getLogger().error("Zip Error when loading jar file {}", path, ioe);
|
||||||
|
|
Loading…
Reference in New Issue