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);
}
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);
}
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);
}
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();
}
}
Aggregations