diff --git a/build.gradle b/build.gradle index a3956dc91..da3ef9882 100644 --- a/build.gradle +++ b/build.gradle @@ -291,7 +291,7 @@ project(':forge') { installer 'cpw.mods:modlauncher:0.11.+' installer 'net.minecraftforge:accesstransformers:0.15.+:shadowed' installer 'net.minecraftforge:eventbus:0.8.+:service' - installer 'net.minecraftforge:forgespi:0.8.+' + installer 'net.minecraftforge:forgespi:0.10.+' installer 'net.minecraftforge:coremods:0.4.+' installer 'net.minecraftforge:unsafe:0.2.+' installer 'com.electronwill.night-config:core:3.4.2' diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java index c77934fdc..1c2705e39 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModClassVisitor.java @@ -75,7 +75,7 @@ public class ModClassVisitor extends ClassVisitor return new ModMethodVisitor(name, desc, annotations); } - public void buildData(final List classes, final List annotations) { + public void buildData(final Set classes, final Set annotations) { classes.add(new ModFileScanData.ClassData(this.asmType, this.asmSuperType, this.interfaces)); final List collect = this.annotations.stream(). filter(ma->ModFileScanData.interestingAnnotations().test(ma.asmType)). diff --git a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java index bd757cb71..2b4a2cee4 100644 --- a/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java +++ b/src/fmllauncher/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java @@ -57,6 +57,7 @@ public class ModFile private final String jarVersion; private Map fileProperties; private IModLanguageProvider loader; + private Throwable scanError; public void setFileProperties(Map fileProperties) { @@ -159,12 +160,18 @@ public class ModFile e.printStackTrace(); } } + if (this.scanError != null) { + throw new RuntimeException(this.scanError); + } return this.fileModFileScanData; } public void setScanResult(final ModFileScanData modFileScanData, final Throwable throwable) { this.futureScanResult = null; this.fileModFileScanData = modFileScanData; + if (throwable != null) { + this.scanError = throwable; + } } @Override diff --git a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLJavaModLanguageProvider.java b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLJavaModLanguageProvider.java index c5af734d5..f4f110ba5 100644 --- a/src/main/java/net/minecraftforge/fml/javafmlmod/FMLJavaModLanguageProvider.java +++ b/src/main/java/net/minecraftforge/fml/javafmlmod/FMLJavaModLanguageProvider.java @@ -95,7 +95,7 @@ public class FMLJavaModLanguageProvider implements IModLanguageProvider .filter(ad -> ad.getAnnotationType().equals(MODANNOTATION)) .peek(ad -> LOGGER.debug(SCAN, "Found @Mod class {} with id {}", ad.getClassType().getClassName(), ad.getAnnotationData().get("value"))) .map(ad -> new FMLModTarget(ad.getClassType().getClassName(), (String)ad.getAnnotationData().get("value"))) - .collect(Collectors.toMap(FMLModTarget::getModId, Function.identity())); + .collect(Collectors.toMap(FMLModTarget::getModId, Function.identity(), (a,b)->a)); scanResult.addLanguageLoader(modTargetMap); }; }