fixed crash report for 1.17
This commit is contained in:
1 parent
5f630e7d1a
commit
38b2e83d05
2 files changed
+9
-10
No files matched your search
@@ -1,7 +1,9 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.class_6396;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -9,19 +11,16 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import carpet.CarpetServer;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
|
||||
@Mixin(CrashReport.class)
|
||||
@Mixin(class_6396.class)
|
||||
public abstract class CrashReport_addScarpetAppsMixin
|
||||
{
|
||||
@Shadow
|
||||
public abstract CrashReportSection getSystemDetailsSection();
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "fillSystemDetails")
|
||||
@Shadow public abstract void method_37123(String string, Supplier<String> supplier);
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void fillSystemDetails(CallbackInfo info) {
|
||||
if (CarpetServer.scriptServer == null || CarpetServer.scriptServer.modules.isEmpty()) return;
|
||||
getSystemDetailsSection().add("Loaded Scarpet Apps", () -> {
|
||||
method_37123("Loaded Scarpet Apps", () -> {
|
||||
return CarpetServer.scriptServer.modules.keySet().stream().collect(Collectors.joining("\n\t\t", "\n\t\t", ""));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user