use of grondag.frex.api.model.DynamicBakedModel in project canvas by vram-guild.
the class MixinItemRenderer method hookRenderModel.
@Inject(at = @At("HEAD"), method = "renderModel", cancellable = true)
private void hookRenderModel(BakedModel model, int color, ItemStack stack, CallbackInfo ci) {
final DynamicBakedModel dynamicModel = (DynamicBakedModel) model;
if (Configurator.itemShaderRender) {
// PERF: redirect most of the enables so we don't have to change state here each time
GuiLightingHelper.suspend();
context.renderModel(dynamicModel, color, stack);
GuiLightingHelper.resume();
ci.cancel();
} else {
if (!dynamicModel.isVanillaAdapter()) {
oldContext.renderModel(dynamicModel, color, stack, (b, q, c, s) -> renderQuadsInner(b, q, c, s));
ci.cancel();
}
}
}
use of grondag.frex.api.model.DynamicBakedModel in project canvas by vram-guild.
the class TerrainRenderContext method tesselateBlock.
/**
* Called from chunk renderer hook.
*/
public void tesselateBlock(BlockState blockState, BlockPos blockPos) {
try {
final BakedModel model = blockRenderManager.getModel(blockState);
aoCalc.clear();
blockInfo.prepareForBlock(blockState, blockPos, model.useAmbientOcclusion());
chunkInfo.beginBlock();
((DynamicBakedModel) model).emitBlockQuads(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, blockInfo.randomSupplier, this);
} catch (final Throwable var9) {
final CrashReport crashReport_1 = CrashReport.create(var9, "Tesselating block in world - Canvas Renderer");
final CrashReportSection crashReportElement_1 = crashReport_1.addElement("Block being tesselated");
CrashReportSection.addBlockInfo(crashReportElement_1, blockPos, blockState);
throw new CrashException(crashReport_1);
}
}
Aggregations