Search in sources :

Example 36 with VertexConsumer

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

Example 37 with VertexConsumer

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();
    }
}
Also used : Identifier(net.minecraft.util.Identifier) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) CapeItem(com.jab125.thonkutil.api.CapeItem) VertexConsumer(net.minecraft.client.render.VertexConsumer) ItemStack(net.minecraft.item.ItemStack) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity)

Example 38 with VertexConsumer

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();
    }
}
Also used : Identifier(net.minecraft.util.Identifier) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) CapeItem(com.jab125.thonkutil.api.CapeItem) VertexConsumer(net.minecraft.client.render.VertexConsumer) ItemStack(net.minecraft.item.ItemStack) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity)

Example 39 with VertexConsumer

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();
    }
}
Also used : HeadFeatureRenderer(net.minecraft.client.render.entity.feature.HeadFeatureRenderer) Identifier(net.minecraft.util.Identifier) VertexConsumer(net.minecraft.client.render.VertexConsumer) ItemStack(net.minecraft.item.ItemStack) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 40 with VertexConsumer

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);
    }
}
Also used : HorseEntity(net.minecraft.entity.passive.HorseEntity) ModelPart(net.minecraft.client.model.ModelPart) HorseHat(party.lemons.biomemakeover.util.extensions.HorseHat) 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