File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
forge/src/main/java/org/embeddedt/modernfix/forge/mixin/core Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1+ package org .embeddedt .modernfix .forge .mixin .core ;
2+
3+ import net .minecraftforge .forgespi .language .IModInfo ;
4+ import net .minecraftforge .logging .CrashReportAnalyser ;
5+ import org .spongepowered .asm .mixin .Final ;
6+ import org .spongepowered .asm .mixin .Mixin ;
7+ import org .spongepowered .asm .mixin .Shadow ;
8+ import org .spongepowered .asm .mixin .injection .At ;
9+ import org .spongepowered .asm .mixin .injection .Inject ;
10+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
11+
12+ import java .util .Map ;
13+
14+ @ Mixin (CrashReportAnalyser .class )
15+ public class CrashReportAnalyserMixin {
16+ @ Shadow @ Final private static Map <IModInfo , String []> SUSPECTED_MODS ;
17+
18+ /**
19+ * @author embeddedt
20+ * @reason Remove ModernFix from the list of suspected mods when a crash happens. Otherwise, we get blamed
21+ * for "registry object not present" crashes if users don't interpret the crash before reporting
22+ * it.
23+ *
24+ * It seems unlikely ModernFix will simultaneously cause a crash while it's not obvious it caused it.
25+ */
26+ @ Inject (method = "buildSuspectedModsSection" , at = @ At ("HEAD" ), require = 0 )
27+ private static void removeOurselvesFromSuspectedMods (StringBuilder stringBuilder , CallbackInfo ci ) {
28+ SUSPECTED_MODS .keySet ().removeIf (iModInfo -> iModInfo .getModId ().equals ("modernfix" ));
29+ }
30+
31+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ mixinextras_version=0.4.1
77mod_id =modernfix
88minecraft_version =1.20.1
99enabled_platforms =fabric,forge
10- forge_version =1.20.1-47.1.3
10+ forge_version =1.20.1-47.4.0
1111parchment_version =2023.07.09
1212refined_storage_version =4392788
1313jei_version =15.8.0.11
You can’t perform that action at this time.
0 commit comments