use of net.minecraft.client.render.VertexConsumer in project meteor-client by MeteorDevelopment.
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 = (float) (-(Integer) blockState.get(BannerBlock.ROTATION) * 360) / 16.0F;
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.VertexConsumer in project ThonkUtil by LimeAppleBoat.
the class ItemElytraRenderer method render.
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l) {
ItemStack itemStack = livingEntity.getEquippedStack(EquipmentSlot.CHEST);
if (itemStack.isOf(Items.ELYTRA) && livingEntity instanceof PlayerEntity && ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem() instanceof CapeItem && ((CapeItem) ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem()).hasElytraTexture() && !((CapeItem) ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem()).has2WingedElytra()) {
Identifier identifier;
AbstractClientPlayerEntity abstractClientPlayerEntity = (AbstractClientPlayerEntity) livingEntity;
identifier = ((CapeItem) ThonkUtilCapes.getCape(abstractClientPlayerEntity).getItem()).getCapeTexture();
matrixStack.push();
matrixStack.translate(0.0D, 0.0D, 0.125D);
this.getContextModel().copyStateTo(this.elytra);
this.elytra.setAngles(livingEntity, f, g, j, k, l);
VertexConsumer elytra = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getArmorCutoutNoCull(identifier), false, itemStack.hasGlint());
this.elytra.render(matrixStack, elytra, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
matrixStack.pop();
}
}
use of net.minecraft.client.render.VertexConsumer in project ThonkUtil by LimeAppleBoat.
the class TwoWingedItemElytraRenderer method render.
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l) {
ItemStack itemStack = livingEntity.getEquippedStack(EquipmentSlot.CHEST);
if (itemStack.isOf(Items.ELYTRA) && livingEntity instanceof PlayerEntity && ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem() instanceof CapeItem && ((CapeItem) ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem()).hasElytraTexture() && ((CapeItem) ThonkUtilCapes.getCape((PlayerEntity) livingEntity).getItem()).has2WingedElytra()) {
Identifier identifier;
AbstractClientPlayerEntity abstractClientPlayerEntity = (AbstractClientPlayerEntity) livingEntity;
identifier = ((CapeItem) ThonkUtilCapes.getCape(abstractClientPlayerEntity).getItem()).getElytraTexture();
matrixStack.push();
matrixStack.translate(0.0D, 0.0D, 0.125D);
this.getContextModel().copyStateTo(this.elytra);
this.elytra.setAngles(livingEntity, f, g, j, k, l);
VertexConsumer elytra = ItemRenderer.getItemGlintConsumer(vertexConsumerProvider, RenderLayer.getArmorCutoutNoCull(identifier), false, itemStack.hasGlint());
this.elytra.render(matrixStack, elytra, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
matrixStack.pop();
}
}
use of net.minecraft.client.render.VertexConsumer in project EnvironmentZ by Globox1997.
the class HeadFeatureRendererMixin method render.
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, LivingEntity livingEntity, float f, float g, float h, float j, float k, float l, CallbackInfo info) {
ItemStack itemStack = livingEntity.getEquippedStack(EquipmentSlot.HEAD);
if (!(itemStack.isEmpty()) && (itemStack.getItem() == ItemInit.WOLF_HELMET)) {
matrixStack.push();
matrixStack.scale(this.scaleX, this.scaleY, this.scaleZ);
((ModelWithHead) ((HeadFeatureRenderer) (Object) this).getContextModel()).getHead().rotate(matrixStack);
matrixStack.translate(0.0D, -1.75D, 0.0D);
matrixStack.scale(1.18F, 1.18F, 1.18F);
VertexConsumer vertexConsumer = ItemRenderer.getItemGlintConsumer(vertexConsumerProvider, this.wolfHelmetModel.getLayer(new Identifier("environmentz", "textures/entity/wolf_helmet.png")), false, itemStack.hasGlint());
this.wolfHelmetModel.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
matrixStack.pop();
info.cancel();
}
}
use of net.minecraft.client.render.VertexConsumer in project Biome-Makeover by Lemonszz.
the class HorseHatFeatureRenderer method render.
@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, HorseEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
if (((HorseHat) entity).hasHat()) {
matrices.scale(1.05F, 1.05F, 1.05F);
CowboyHatModel<HorseEntity> hatModel = new CowboyHatModel<>();
((ModelPart) ((HorseEntityModel) this.getContextModel()).getHeadParts().iterator().next()).rotate(matrices);
matrices.translate(0F, -0.23F, 0.15);
matrices.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(-25F));
VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumers, hatModel.getLayer(this.getTexture(entity)), true, false);
hatModel.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F);
}
}
Aggregations