aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-08-13 17:52:24 +0800
committershedaniel <daniel@shedaniel.me>2021-08-13 17:52:24 +0800
commit7e64a60c6673026bd0f86dfa0db22dafa62ae040 (patch)
treea7cb50d3d599cad24ce104d54507775703bffcfa /runtime
parent03b5131163fb219546d5c643074cee8a04488b76 (diff)
downloadRoughlyEnoughItems-7e64a60c6673026bd0f86dfa0db22dafa62ae040.tar.gz
RoughlyEnoughItems-7e64a60c6673026bd0f86dfa0db22dafa62ae040.tar.bz2
RoughlyEnoughItems-7e64a60c6673026bd0f86dfa0db22dafa62ae040.zip
Fix CrashReportUtils' name
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java13
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/util/CrashReportUtils.java7
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java5
3 files changed, 14 insertions, 11 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java
index b4b213c7f..40aa24ccb 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/BatchedEntryRendererManager.java
@@ -34,7 +34,6 @@ import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer;
import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.impl.client.util.CrashReportUtils;
import net.minecraft.CrashReport;
-import net.minecraft.ReportedException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import org.apache.commons.lang3.mutable.MutableInt;
@@ -90,7 +89,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Adding entry");
CrashReportUtils.renderer(report, currentEntry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
toRender.add(widget);
@@ -164,7 +163,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry background");
CrashReportUtils.renderer(report, entry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
firstRenderer.startBatch(first, extraData[0], matrices, delta);
@@ -178,7 +177,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry base");
CrashReportUtils.renderer(report, entry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
immediate.endBatch();
@@ -192,7 +191,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry base");
CrashReportUtils.renderer(report, entry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
immediate.endBatch();
@@ -206,7 +205,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry extra");
CrashReportUtils.renderer(report, entry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
if (debugTime) time.add(System.nanoTime() - l);
@@ -227,7 +226,7 @@ public class BatchedEntryRendererManager {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry");
CrashReportUtils.renderer(report, entry);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/util/CrashReportUtils.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/util/CrashReportUtils.java
index c3c66ab13..d55567909 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/util/CrashReportUtils.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/util/CrashReportUtils.java
@@ -26,12 +26,13 @@ package me.shedaniel.rei.impl.client.util;
import me.shedaniel.rei.api.client.gui.Renderer;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
+import net.minecraft.ReportedException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
public class CrashReportUtils {
public static CrashReport essential(Throwable throwable, String task) {
- CrashReport report = CrashReport.forThrowable(throwable, "Rendering background of entry");
+ CrashReport report = CrashReport.forThrowable(throwable, task);
screen(report, Minecraft.getInstance().screen);
return report;
}
@@ -54,4 +55,8 @@ public class CrashReportUtils {
}
}
}
+
+ public static ReportedException throwReport(CrashReport report) {
+ return new ReportedException(report);
+ }
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
index 421422d4a..04f364c75 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/common/entry/AbstractEntryStack.java
@@ -41,7 +41,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
-import net.minecraft.ReportedException;
import net.minecraft.client.Minecraft;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
@@ -171,7 +170,7 @@ public abstract class AbstractEntryStack<A> implements EntryStack<A>, Renderer {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Rendering entry");
CrashReportUtils.renderer(report, this);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}
@@ -195,7 +194,7 @@ public abstract class AbstractEntryStack<A> implements EntryStack<A>, Renderer {
} catch (Throwable throwable) {
CrashReport report = CrashReportUtils.essential(throwable, "Getting tooltips");
CrashReportUtils.renderer(report, this);
- throw new ReportedException(report);
+ throw CrashReportUtils.throwReport(report);
}
}