Add debug tool for weird crashes, off by default
This commit is contained in:
parent
7a2b57221e
commit
cb23ee5a54
|
|
@ -20,6 +20,7 @@ public class ModernFixEarlyConfig {
|
|||
this.addMixinRule("feature.branding", true);
|
||||
this.addMixinRule("feature.measure_time", true);
|
||||
this.addMixinRule("feature.reduce_loading_screen_freezes", false);
|
||||
this.addMixinRule("feature.direct_stack_trace", false);
|
||||
this.addMixinRule("perf.fast_registry_validation", true);
|
||||
this.addMixinRule("perf.use_integrated_resources", true);
|
||||
this.addMixinRule("perf.remove_biome_temperature_cache", true);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package org.embeddedt.modernfix.mixin.feature.direct_stack_trace;
|
||||
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(CrashReport.class)
|
||||
public class CrashReportMixin {
|
||||
@Shadow @Final private Throwable exception;
|
||||
|
||||
@Inject(method = "addCategory(Ljava/lang/String;I)Lnet/minecraft/CrashReportCategory;", at = @At(value = "INVOKE", target = "Ljava/io/PrintStream;println(Ljava/lang/String;)V"))
|
||||
private void dumpStacktrace(String s, int i, CallbackInfoReturnable<CrashReportCategory> cir) {
|
||||
new Exception("ModernFix crash stacktrace").printStackTrace();
|
||||
if(this.exception != null)
|
||||
this.exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
@ -44,6 +44,7 @@
|
|||
"feature.measure_time.SimpleReloadableResourceManagerMixin",
|
||||
"feature.measure_time.ProfiledReloadInstanceMixin",
|
||||
"feature.branding.BrandingControlMixin",
|
||||
"feature.direct_stack_trace.CrashReportMixin",
|
||||
"perf.kubejs.TagIngredientJSMixin",
|
||||
"perf.kubejs.TagWrapperMixin",
|
||||
"perf.kubejs.RecipeEventJSMixin",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user