Fix vanilla crash classes not being preloaded. Closes #4769

Fix classes not being aggregated for mods using the new annotation cache.
This commit is contained in:
LexManos 2018-02-26 15:36:39 -08:00
parent 49be9b273e
commit e299489493
4 changed files with 31 additions and 7 deletions

View File

@ -122,9 +122,18 @@ def extraTxts = [
if (project.hasProperty('forgeJenkinsPass'))
extraTxts += changelog
task extractAnnotationsVanilla(type: net.minecraftforge.gradle.tasks.TaskExtractAnnotationsText, dependsOn: deobfuscateJar) {
jar = deobfuscateJar.outJar
output = 'build/vanilla_annotations.json'
}
outputJar {
classifier = 'universal'
from extraTxts
from(extractAnnotationsVanilla){
into 'META-INF'
}
dependsOn extractAnnotationsVanilla
// add crowdin locales
from { crowdin.getDidWork() ? zipTree(crowdin.output) : null}
@ -392,7 +401,7 @@ task resetBuildNumber << {
ciWriteBuildNumber.execute()
}
// re-add old tasks for jenkins compat
// should be remvoed, and the jenkisn fixed when no longer building with FG 1.2
// should be removed, and the jenkins fixed when no longer building with FG 1.2
task setupForge { dependsOn 'setup', 'ciWriteBuildNumber' }
task buildPackages { dependsOn 'build' }

View File

@ -266,13 +266,13 @@
}
},
{
"name": "com.mojang:realms:1.10.18",
"name": "com.mojang:realms:1.10.19",
"downloads": {
"artifact": {
"size": 3259151,
"sha1": "77a86d7596f49a6b01ad48f1a4a0d6546bc60df5",
"path": "com/mojang/realms/1.10.18/realms-1.10.18.jar",
"url": "https://libraries.minecraft.net/com/mojang/realms/1.10.18/realms-1.10.18.jar"
"size": 7134997,
"sha1": "c0e1cddb173faa8bf69a4236211cfd0af6c6150d",
"path": "com/mojang/realms/1.10.19/realms-1.10.19.jar",
"url": "https://libraries.minecraft.net/com/mojang/realms/1.10.19/realms-1.10.19.jar"
}
}
},
@ -719,6 +719,6 @@
"minecraftArguments": "--username ${auth_player_name} --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid ${auth_uuid} --accessToken ${auth_access_token} --userType ${user_type} --versionType ${version_type}",
"minimumLauncherVersion": 18,
"releaseTime": "2017-09-18T08:39:46+00:00",
"time": "2018-01-18T09:43:47+00:00",
"time": "2018-02-15T16:26:45+00:00",
"type": "release"
}

View File

@ -25,6 +25,7 @@ import static net.minecraftforge.common.config.Configuration.CATEGORY_CLIENT;
import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL;
import java.io.File;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.cert.Certificate;
@ -85,6 +86,7 @@ import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.ModMetadata;
import net.minecraftforge.fml.common.WorldAccessContainer;
import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
import net.minecraftforge.fml.common.discovery.json.JsonAnnotationLoader;
import net.minecraftforge.fml.common.event.FMLConstructionEvent;
import net.minecraftforge.fml.common.event.FMLLoadCompleteEvent;
import net.minecraftforge.fml.common.event.FMLModIdMappingEvent;
@ -421,6 +423,11 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
InputStream is = ForgeModContainer.class.getResourceAsStream("/META-INF/vanilla_annotations.json");
if (is != null)
JsonAnnotationLoader.loadJson(is, null, evt.getASMHarvestedData());
log.debug("Loading Vanilla annotations: " + is);
List<String> all = Lists.newArrayList();
for (ASMData asm : evt.getASMHarvestedData().getAll(ICrashReportDetail.class.getName().replace('.', '/')))
all.add(asm.getClassName());

View File

@ -129,6 +129,14 @@ public class JarDiscoverer implements ITypeDiscoverer
ZipEntry json = jar.getEntry(JsonAnnotationLoader.ANNOTATION_JSON);
Multimap<String, ASMData> annos = JsonAnnotationLoader.loadJson(jar.getInputStream(json), candidate, table);
for (ZipEntry e : Collections.list(jar.entries()))
{
if (!e.getName().startsWith("__MACOSX") && !e.getName().startsWith("META-INF/") && e.getName().endsWith(".class"))
{
candidate.addClassEntry(e.getName());
}
}
for (Entry<Type, Constructor<? extends ModContainer>> entry : ModContainerFactory.modTypes.entrySet())
{
Type type = entry.getKey();