Search in sources :

Example 26 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer 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();
}
Also used : BlockState(net.minecraft.block.BlockState) RenderLayer(net.minecraft.client.render.RenderLayer) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 27 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer 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();
}
Also used : BlockState(net.minecraft.block.BlockState) RenderLayer(net.minecraft.client.render.RenderLayer) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 28 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project Paradise-Lost by devs-immortal.

the class PhygWingLayer method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, PhygEntity phyg, float limbAngle, float limbDistance, float tickDelta, float customAngle, float netHeadYaw, float headPitch) {
    VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(TEXTURE_WINGS));
    this.model.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
}
Also used : VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 29 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.

the class FireflyEntityRenderer method render.

@Override
public void render(FireflyEntity entity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
    matrixStack.push();
    // you may need to adjust this
    matrixStack.scale(1, 1, 1);
    matrixStack.translate(0, 0.3, 0);
    matrixStack.multiply(this.dispatcher.getRotation());
    matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180.0F));
    MatrixStack.Entry entry = matrixStack.peek();
    Matrix4f matrix4f = entry.getPositionMatrix();
    Matrix3f matrix3f = entry.getNormalMatrix();
    VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(LAYER);
    int j = getLight(i);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 0.0F, 0, 0, 1);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 1.0F, 0, 1, 1);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 1.0F, 1, 1, 0);
    vertex(vertexConsumer, matrix4f, matrix3f, j, 0.0F, 1, 0, 0);
    matrixStack.pop();
    super.render(entity, f, g, matrixStack, vertexConsumerProvider, i);
}
Also used : Matrix4f(net.minecraft.util.math.Matrix4f) Matrix3f(net.minecraft.util.math.Matrix3f) MatrixStack(net.minecraft.client.util.math.MatrixStack) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 30 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.

the class WardenEntityDotFeatureRendererAlt method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, WardenEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
    if (entity.shouldRender) {
        VertexConsumer vertexConsumer = vertexConsumers.getBuffer(this.OVERLAY);
        int a = calculateLight(getBlockLight(entity, entity.getBlockPos()));
        float b = colors(entity.getWorld().getTime());
        this.getContextModel().render(matrices, vertexConsumer, a, OverlayTexture.DEFAULT_UV, b, b, b, 1.0f);
    }
}
Also used : VertexConsumer(net.minecraft.client.render.VertexConsumer)

Aggregations

VertexConsumer (net.minecraft.client.render.VertexConsumer)44 Identifier (net.minecraft.util.Identifier)11 ItemStack (net.minecraft.item.ItemStack)8 RenderLayer (net.minecraft.client.render.RenderLayer)7 BlockState (net.minecraft.block.BlockState)5 Matrix4f (net.minecraft.util.math.Matrix4f)5 MatrixStack (net.minecraft.client.util.math.MatrixStack)4 Matrix3f (net.minecraft.util.math.Matrix3f)4 CapeItem (com.jab125.thonkutil.api.CapeItem)3 Quaternion (net.minecraft.util.math.Quaternion)3 Inject (org.spongepowered.asm.mixin.injection.Inject)3 MainMenu (com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu)2 Cape (com.tangykiwi.kiwiclient.modules.other.Cape)2 ModelPart (net.minecraft.client.model.ModelPart)2 AbstractClientPlayerEntity (net.minecraft.client.network.AbstractClientPlayerEntity)2 Vector3f (net.minecraft.client.util.math.Vector3f)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)2 Vec3f (net.minecraft.util.math.Vec3f)2 Pair (com.mojang.datafixers.util.Pair)1 GlowflyEntity (com.toadstoolstudios.sprout.entities.GlowflyEntity)1