mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
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:
1 parent
49be9b273e
commit
e299489493
4 files changed
+31
-7
No files matched your search
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user