use of net.minecraft.block.BlockRenderType in project AstralSorcery by HellFirePvP.
the class RenderingUtils method renderSimpleBlockModelCurrentWorld.
public static void renderSimpleBlockModelCurrentWorld(BlockState state, MatrixStack renderStack, IVertexBuilder buf, BlockPos pos, @Nullable TileEntity te, int combinedOverlayIn, boolean checkRenderSide) {
BlockRenderType brt = state.getRenderType();
if (brt == BlockRenderType.INVISIBLE) {
return;
}
BlockRendererDispatcher brd = Minecraft.getInstance().getBlockRendererDispatcher();
IModelData data = EmptyModelData.INSTANCE;
if (te != null) {
data = te.getModelData();
}
if (brt == BlockRenderType.MODEL) {
IBakedModel model = brd.getModelForState(state);
brd.getBlockModelRenderer().renderModel(Minecraft.getInstance().world, model, state, pos, renderStack, buf, checkRenderSide, rand, state.getPositionRandom(pos), combinedOverlayIn, data);
}
}
use of net.minecraft.block.BlockRenderType in project AstralSorcery by HellFirePvP.
the class RenderingUtils method renderSimpleBlockModel.
public static void renderSimpleBlockModel(BlockState state, MatrixStack renderStack, IVertexBuilder vb, BlockPos pos, @Nullable TileEntity te, boolean checkRenderSide) {
if (plainRenderWorld == null) {
plainRenderWorld = new EmptyRenderWorld(() -> RegistryUtil.client().getValue(Registry.BIOME_KEY, Biomes.PLAINS));
}
BlockRenderType brt = state.getRenderType();
if (brt == BlockRenderType.INVISIBLE) {
return;
}
BlockRendererDispatcher brd = Minecraft.getInstance().getBlockRendererDispatcher();
IModelData data = EmptyModelData.INSTANCE;
if (te != null) {
data = te.getModelData();
}
brd.renderModel(state, pos, plainRenderWorld, renderStack, vb, checkRenderSide, rand, data);
}
Aggregations