Search in sources :

Example 11 with CrashReportSection

use of net.minecraft.util.crash.CrashReportSection in project fabric by FabricMC.

the class TerrainRenderContext method tesselateBlock.

/**
 * Called from chunk renderer hook.
 */
public boolean tesselateBlock(BlockState blockState, BlockPos blockPos, final BakedModel model) {
    try {
        aoCalc.clear();
        blockInfo.prepareForBlock(blockState, blockPos, model.useAmbientOcclusion());
        chunkInfo.beginBlock();
        ((FabricBakedModel) model).emitBlockQuads(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, blockInfo.randomSupplier, this);
    } catch (Throwable var9) {
        CrashReport crashReport_1 = CrashReport.create(var9, "Tesselating block in world - Indigo Renderer");
        CrashReportSection crashReportElement_1 = crashReport_1.addElement("Block being tesselated");
        CrashReportSection.addBlockInfo(crashReportElement_1, blockPos, blockState);
        throw new CrashException(crashReport_1);
    }
    return chunkInfo.resultFlags[blockInfo.defaultLayerIndex];
}
Also used : CrashException(net.minecraft.util.crash.CrashException) CrashReport(net.minecraft.util.crash.CrashReport) FabricBakedModel(net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel) CrashReportSection(net.minecraft.util.crash.CrashReportSection)

Example 12 with CrashReportSection

use of net.minecraft.util.crash.CrashReportSection in project lithium-fabric by CaffeineMC.

the class DataTrackerMixin method onGetException.

private static <T> CrashException onGetException(Throwable cause, TrackedData<T> data) {
    CrashReport report = CrashReport.create(cause, "Getting synced entity data");
    CrashReportSection section = report.addElement("Synced entity data");
    section.add("Data ID", data);
    return new CrashException(report);
}
Also used : CrashException(net.minecraft.util.crash.CrashException) CrashReport(net.minecraft.util.crash.CrashReport) CrashReportSection(net.minecraft.util.crash.CrashReportSection)

Aggregations

CrashReportSection (net.minecraft.util.crash.CrashReportSection)12 CrashException (net.minecraft.util.crash.CrashException)11 CrashReport (net.minecraft.util.crash.CrashReport)11 GuiElement (de.johni0702.minecraft.gui.element.GuiElement)4 ReadableDimension (de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension)4 ReadablePoint (de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint)4 OffsetGuiRenderer (de.johni0702.minecraft.gui.OffsetGuiRenderer)3 AbstractComposedGuiElement (de.johni0702.minecraft.gui.element.AbstractComposedGuiElement)2 ComposedGuiElement (de.johni0702.minecraft.gui.element.ComposedGuiElement)2 Point (de.johni0702.minecraft.gui.utils.lwjgl.Point)2 FabricBakedModel (net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel)2 Pair (org.apache.commons.lang3.tuple.Pair)2 Dimension (de.johni0702.minecraft.gui.utils.lwjgl.Dimension)1 DynamicBakedModel (grondag.frex.api.model.DynamicBakedModel)1 ClientSpriteRegistryCallback (net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback)1 BakedModel (net.minecraft.client.render.model.BakedModel)1 Sprite (net.minecraft.client.texture.Sprite)1 Identifier (net.minecraft.util.Identifier)1 ModifyVariable (org.spongepowered.asm.mixin.injection.ModifyVariable)1