use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.
the class MangroveBoatEntityRenderer method render.
public void render(MangroveBoatEntity boatEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
matrixStack.push();
matrixStack.translate(0.0D, 0.375D, 0.0D);
matrixStack.multiply(Vec3f.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(Vec3f.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 Vec3f(1.0F, 0.0F, 1.0F), boatEntity.interpolateBubbleWobble(g), true));
}
Identifier texture = this.texture;
MangroveBoatEntityModel model = this.model;
Identifier identifier = texture;
MangroveBoatEntityModel boatEntityModel = model;
matrixStack.scale(-1.0F, -1.0F, 1.0F);
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
boatEntityModel.setAngles(boatEntity, g, 0.0F, -0.1F, 0.0F, 0.0F);
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(boatEntityModel.getLayer(identifier));
boatEntityModel.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
if (!boatEntity.isSubmergedInWater()) {
VertexConsumer vertexConsumer2 = vertexConsumerProvider.getBuffer(RenderLayer.getWaterMask());
boatEntityModel.getWaterPatch().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 wildmod by Osmiooo.
the class ChestBoatEntityRenderer method render.
public void render(ChestBoatEntity boatEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
matrixStack.push();
matrixStack.translate(0.0D, 0.375D, 0.0D);
matrixStack.multiply(Vec3f.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(Vec3f.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 Vec3f(1.0F, 0.0F, 1.0F), boatEntity.interpolateBubbleWobble(g), true));
}
Pair<Identifier, ChestBoatEntityModel> pair = (Pair) this.texturesAndModels.get(boatEntity.getBoatType());
Identifier identifier = (Identifier) pair.getFirst();
ChestBoatEntityModel boatEntityModel = (ChestBoatEntityModel) pair.getSecond();
matrixStack.scale(-1.0F, -1.0F, 1.0F);
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
boatEntityModel.setAngles(boatEntity, g, 0.0F, -0.1F, 0.0F, 0.0F);
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(boatEntityModel.getLayer(identifier));
boatEntityModel.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
if (!boatEntity.isSubmergedInWater()) {
VertexConsumer vertexConsumer2 = vertexConsumerProvider.getBuffer(RenderLayer.getWaterMask());
boatEntityModel.getWaterPatch().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 wildmod by Osmiooo.
the class WardenEntityDotFeatureRenderer 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);
}
}
use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.
the class WardenEntityEmissiveFeatureRenderer 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) {
String string = Formatting.strip(entity.getName().getString());
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(this.OVERLAY);
if ("Osmiooo".equals(string)) {
vertexConsumer = vertexConsumers.getBuffer(this.SECRET_OVERLAY);
}
this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0f, 1.0f, 1.0f, 1.0f);
}
}
use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.
the class WardenEntityTendrilsFeatureRenderer 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) {
String string = Formatting.strip(entity.getName().getString());
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(this.TENDRILS);
if ("Osmiooo".equals(string)) {
vertexConsumer = vertexConsumers.getBuffer(this.SECRET_TENDRILS);
}
this.getContextModel().render(matrices, vertexConsumer, (int) calculateLight(entity), OverlayTexture.DEFAULT_UV, calculateColors(entity), calculateColors(entity), calculateColors(entity), 1.0f);
}
}
Aggregations