Prevent Forge's crash report analyser from complaining about ModernFix
This commit is contained in:
parent
fcea407708
commit
967b0c1982
|
|
@ -0,0 +1,31 @@
|
|||
package org.embeddedt.modernfix.forge.mixin.core;
|
||||
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import net.minecraftforge.logging.CrashReportAnalyser;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(CrashReportAnalyser.class)
|
||||
public class CrashReportAnalyserMixin {
|
||||
@Shadow @Final private static Map<IModInfo, String[]> SUSPECTED_MODS;
|
||||
|
||||
/**
|
||||
* @author embeddedt
|
||||
* @reason Remove ModernFix from the list of suspected mods when a crash happens. Otherwise, we get blamed
|
||||
* for "registry object not present" crashes if users don't interpret the crash before reporting
|
||||
* it.
|
||||
*
|
||||
* It seems unlikely ModernFix will simultaneously cause a crash while it's not obvious it caused it.
|
||||
*/
|
||||
@Inject(method = "buildSuspectedModsSection", at = @At("HEAD"), require = 0)
|
||||
private static void removeOurselvesFromSuspectedMods(StringBuilder stringBuilder, CallbackInfo ci) {
|
||||
SUSPECTED_MODS.keySet().removeIf(iModInfo -> iModInfo.getModId().equals("modernfix"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ mixinextras_version=0.4.1
|
|||
mod_id=modernfix
|
||||
minecraft_version=1.20.1
|
||||
enabled_platforms=fabric,forge
|
||||
forge_version=1.20.1-47.1.3
|
||||
forge_version=1.20.1-47.4.0
|
||||
parchment_version=2023.07.09
|
||||
refined_storage_version=4392788
|
||||
jei_version=15.8.0.11
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user