Search in sources :

Example 41 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project Biome-Makeover by Lemonszz.

the class BMBoatRender method render.

public void render(BMBoatEntity boatEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
    matrixStack.push();
    matrixStack.translate(0.0D, 0.375D, 0.0D);
    matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(180.0F - f));
    float h = (float) boatEntity.getDamageWobbleTicks() - g;
    float j = boatEntity.getDamageWobbleStrength() - g;
    if (j < 0.0F) {
        j = 0.0F;
    }
    if (h > 0.0F) {
        matrixStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(MathHelper.sin(h) * h * j / 10.0F * (float) boatEntity.getDamageWobbleSide()));
    }
    float k = boatEntity.interpolateBubbleWobble(g);
    if (!MathHelper.approximatelyEquals(k, 0.0F)) {
        matrixStack.multiply(new Quaternion(new Vector3f(1.0F, 0.0F, 1.0F), boatEntity.interpolateBubbleWobble(g), true));
    }
    matrixStack.scale(-1.0F, -1.0F, 1.0F);
    matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
    this.model.setAngles(boatEntity, g, 0.0F, -0.1F, 0.0F, 0.0F);
    VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(this.model.getLayer(this.getTexture(boatEntity)));
    this.model.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
    VertexConsumer vertexConsumer2 = vertexConsumerProvider.getBuffer(RenderLayer.getWaterMask());
    this.model.getBottom().render(matrixStack, vertexConsumer2, i, OverlayTexture.DEFAULT_UV);
    matrixStack.pop();
    super.render(boatEntity, f, g, matrixStack, vertexConsumerProvider, i);
}
Also used : Quaternion(net.minecraft.util.math.Quaternion) Vector3f(net.minecraft.client.util.math.Vector3f) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 42 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project Biome-Makeover by Lemonszz.

the class TapestryBlockEntityRenderer method renderTapestry.

public static void renderTapestry(MatrixStack matrixStack, VertexConsumerProvider vertexConsumer, int light, int overlay, ModelPart bannerPart, DyeColor color) {
    Identifier id;
    if (color == null)
        id = BiomeMakeover.ID("textures/tapestry/adjudicator_tapestry.png");
    else
        id = BiomeMakeover.ID("textures/tapestry/" + color.getName() + "_tapestry.png");
    VertexConsumer vc = vertexConsumer.getBuffer(RenderLayer.getEntitySolid(id));
    bannerPart.render(matrixStack, vc, light, overlay);
}
Also used : SpriteIdentifier(net.minecraft.client.util.SpriteIdentifier) Identifier(net.minecraft.util.Identifier) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 43 with VertexConsumer

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

the class FlyingCowWingLayer method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, FlyingCowEntity cow, float limbAngle, float limbDistance, float tickDelta, float customAngle, float netHeadYaw, float headPitch) {
    VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(TEXTURE));
    this.model.setAngles(cow, limbAngle, limbDistance, customAngle, netHeadYaw, headPitch);
    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 44 with VertexConsumer

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

the class SheepuffCoatLayer method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, SheepuffEntity sheepuff, float limbAngle, float limbDistance, float tickDelta, float customAngle, float netHeadYaw, float headPitch) {
    if (!sheepuff.isSheared() && !sheepuff.isInvisible()) {
        GlStateManager.pushMatrix();
        if (sheepuff.hasCustomName() && "jeb_".equals(sheepuff.getName().asString())) {
            int i = sheepuff.age / 25 + sheepuff.getEntityId();
            int j1 = DyeColor.values().length;
            int k = i % j1;
            int l = (i + 1) % j1;
            float f = ((float) (sheepuff.age % 25) + tickDelta) / 25.0F;
            float[] afloat1 = SheepuffEntity.getRgbColor(DyeColor.byId(k));
            float[] afloat2 = SheepuffEntity.getRgbColor(DyeColor.byId(l));
            GlStateManager.color4f(afloat1[0] * (1.0F - f) + afloat2[0] * f, afloat1[1] * (1.0F - f) + afloat2[1] * f, afloat1[2] * (1.0F - f) + afloat2[2] * f, 1.0f);
        } else {
            float[] dye = SheepuffEntity.getRgbColor(sheepuff.getColor());
            GlStateManager.color4f(dye[0], dye[1], dye[2], 1.0f);
        }
        if (sheepuff.isPuffed()) {
            this.puffedModel.copyStateTo(this.getContextModel());
            this.puffedModel.animateModel(sheepuff, limbAngle, limbDistance, tickDelta);
            VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(TEXTURE_FUR));
            this.puffedModel.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
        } else {
            this.woolModel.copyStateTo(this.getContextModel());
            this.woolModel.animateModel(sheepuff, limbAngle, limbDistance, tickDelta);
            VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(TEXTURE_FUR));
            this.woolModel.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
        }
        GlStateManager.popMatrix();
    }
}
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