fixed crash report for 1.17

This commit is contained in:
gnembon committed 2021-05-31 16:14:10 -03:00
1 parent 5f630e7d1a
commit 38b2e83d05
2 files changed
+8 -9

No files matched your search

+2 -2
View File
@@ -5,9 +5,9 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html
minecraft_version=1.17-pre1
yarn_mappings=1.17-pre1+build.1
yarn_mappings=1.17-pre1+build.14
loader_version=0.11.3
fabric_version=0.34.7+1.17
fabric_version=0.34.8+1.17
# Mod Properties
mod_version = 1.4.38
@@ -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();
@Shadow public abstract void method_37123(String string, Supplier<String> supplier);
@Inject(at = @At("RETURN"), method = "fillSystemDetails")
@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", ""));
});
}