use of net.minecraft.client.render.RenderLayer in project Biome-Makeover by Lemonszz.
the class StoneGolemEntityRender method render.
@Override
public void render(StoneGolemEntity entity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
matrixStack.push();
boolean visible = this.isVisible(entity);
boolean isInvis = !visible && !entity.isInvisibleTo(MinecraftClient.getInstance().player);
boolean outline = MinecraftClient.getInstance().hasOutline(entity);
matrixStack.scale(-1.0F, -1.0F, 1.0F);
// ????
matrixStack.translate(0.0D, -1.5010000467300415D, 0.0D);
RenderLayer renderLayer = this.getRenderLayer(entity, visible, isInvis, outline);
if (renderLayer != null) {
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(renderLayer);
int overlay = getOverlay(entity, this.getAnimationCounter(entity, g));
getModel().renderBase(matrixStack, vertexConsumer, i, overlay, 1F, 1F, 1F, isInvis ? 0.15F : 1.0F);
}
matrixStack.pop();
super.render(entity, f, g, matrixStack, vertexConsumerProvider, i);
}
use of net.minecraft.client.render.RenderLayer in project Client by MatHax.
the class BannerBlockEntityRendererMixin method renderCrossbar.
private void renderCrossbar(BannerBlockEntity bannerBlockEntity, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) {
matrixStack.push();
BlockState blockState = bannerBlockEntity.getCachedState();
matrixStack.translate(0.5D, -0.1666666716337204D, 0.5D);
float h = -(blockState.get(WallBannerBlock.FACING)).asRotation();
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(h));
matrixStack.translate(0.0D, -0.3125D, -0.4375D);
matrixStack.push();
matrixStack.scale(0.6666667F, -0.6666667F, -0.6666667F);
VertexConsumer vertexConsumer = ModelLoader.BANNER_BASE.getVertexConsumer(vertexConsumerProvider, RenderLayer::getEntitySolid);
this.crossbar.render(matrixStack, vertexConsumer, i, j);
matrixStack.pop();
matrixStack.pop();
}
use of net.minecraft.client.render.RenderLayer in project Client by MatHax.
the class BannerBlockEntityRendererMixin method renderPillar.
private void renderPillar(BannerBlockEntity bannerBlockEntity, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) {
matrixStack.push();
BlockState blockState = bannerBlockEntity.getCachedState();
matrixStack.translate(0.5D, 0.5D, 0.5D);
float h = -blockState.get(WallBannerBlock.FACING).asRotation();
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(h));
matrixStack.push();
matrixStack.scale(0.6666667F, -0.6666667F, -0.6666667F);
VertexConsumer vertexConsumer = ModelLoader.BANNER_BASE.getVertexConsumer(vertexConsumerProvider, RenderLayer::getEntitySolid);
this.pillar.render(matrixStack, vertexConsumer, i, j);
matrixStack.pop();
matrixStack.pop();
}
use of net.minecraft.client.render.RenderLayer in project dark-enchanting by frqnny.
the class DarkEnchanterBlockEntityRenderer method render.
@Override
public void render(DarkEnchanterBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
matrices.push();
matrices.translate(0.5D, 0.75D, 0.5D);
float g = (float) blockEntity.ticks + tickDelta;
matrices.translate(0.0D, (0.1F + MathHelper.sin(g * 0.1F) * 0.01F), 0.0D);
float h = blockEntity.bookRotation - blockEntity.bookRotationPrev;
while (h >= 3.1415927F) {
h -= 6.2831855F;
}
while (h < -3.1415927F) {
h += 6.2831855F;
}
float k = blockEntity.bookRotationPrev + h * tickDelta;
matrices.multiply(Vec3f.POSITIVE_Y.getRadialQuaternion(-k));
matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(80.0F));
float l = MathHelper.lerp(tickDelta, blockEntity.pageAngle, blockEntity.nextPageAngle);
float m = MathHelper.fractionalPart(l + 0.25F) * 1.6F - 0.3F;
float n = MathHelper.fractionalPart(l + 0.75F) * 1.6F - 0.3F;
float o = MathHelper.lerp(tickDelta, blockEntity.pageTurningSpeed, blockEntity.nextPageTurningSpeed);
this.book.setPageAngles(g, MathHelper.clamp(m, 0.0F, 1.0F), MathHelper.clamp(n, 0.0F, 1.0F), o);
VertexConsumer vertexConsumer = BOOK_TEX.getVertexConsumer(vertexConsumers, RenderLayer::getEntitySolid);
this.book.render(matrices, vertexConsumer, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
}
use of net.minecraft.client.render.RenderLayer in project Indium by comp500.
the class AbstractMeshConsumer method tesselateQuad.
/**
* Determines color index and render layer, then routes to appropriate
* tesselate routine based on material properties.
*/
private void tesselateQuad(MutableQuadViewImpl quad, RenderMaterialImpl.Value mat, int textureIndex) {
final int colorIndex = mat.disableColorIndex(textureIndex) ? -1 : quad.colorIndex();
final RenderLayer renderLayer = blockInfo.effectiveRenderLayer(mat.blendMode(textureIndex));
if (blockInfo.defaultAo && !mat.disableAo(textureIndex)) {
if (mat.emissive(textureIndex)) {
tesselateSmoothEmissive(quad, renderLayer, colorIndex);
} else {
tesselateSmooth(quad, renderLayer, colorIndex);
}
} else {
if (mat.emissive(textureIndex)) {
tesselateFlatEmissive(quad, renderLayer, colorIndex);
} else {
tesselateFlat(quad, renderLayer, colorIndex);
}
}
}
Aggregations