Search in sources :

Example 31 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.

the class WardenEntitySoulsFeatureRenderer 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.SOULS);
        if ("Osmiooo".equals(string)) {
            vertexConsumer = vertexConsumers.getBuffer(this.SECRET_SOULS);
        }
        this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, calcBeats(entity), calcBeats(entity), calcBeats(entity), 1.0f);
    }
}
Also used : VertexConsumer(net.minecraft.client.render.VertexConsumer)

Example 32 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project EmissiveMod by Traben-0.

the class MIX_TridentEntityRenderer method changeEmissiveTexture.

@Inject(method = "render(Lnet/minecraft/entity/projectile/TridentEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/TridentEntityModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V", shift = At.Shift.AFTER))
private void changeEmissiveTexture(TridentEntity tridentEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo ci) {
    if (ETFConfigData.enableTridents && ETFConfigData.enableEmissiveTextures) {
        UUID id = tridentEntity.getUuid();
        String path = TridentEntityModel.TEXTURE.toString();
        String name = UUID_TridentName.get(id) != null ? "_" + UUID_TridentName.get(id).toLowerCase().replaceAll("[^a-z0-9/_.-]", "") : "";
        String fileString = UUID_TridentName.get(id) != null ? path.replace(".png", "_" + name + ".png") : path;
        if (!Texture_Emissive.containsKey(fileString)) {
            for (String suffix : emissiveSuffix) {
                Identifier possibleId = new Identifier(fileString.replace(".png", suffix + ".png"));
                if (isExistingFile(possibleId)) {
                    Texture_Emissive.put(fileString, possibleId);
                }
            }
            if (!Texture_Emissive.containsKey(fileString)) {
                Texture_Emissive.put(fileString, null);
            }
        }
        if (Texture_Emissive.get(fileString) != null) {
            VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderLayer.getBeaconBeam(Texture_Emissive.get(fileString), true));
            this.model.render(matrixStack, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
        }
    }
}
Also used : Identifier(net.minecraft.util.Identifier) VertexConsumer(net.minecraft.client.render.VertexConsumer) UUID(java.util.UUID) Inject(org.spongepowered.asm.mixin.injection.Inject)

Example 33 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project VisualOverhaul by TeamMidnightDust.

the class FurnaceBlockEntityRenderer method render.

public void render(E blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
    if (VOConfig.furnace && blockEntity != null) {
        BlockState blockState = blockEntity.getCachedState();
        int lightAtBlock = WorldRenderer.getLightmapCoordinates(Objects.requireNonNull(blockEntity.getWorld()), blockEntity.getPos().offset(blockState.get(AbstractFurnaceBlock.FACING)));
        ItemStack item1 = blockEntity.getStack(0);
        ItemStack item2 = blockEntity.getStack(1);
        float angle = (blockState.get(AbstractFurnaceBlock.FACING)).asRotation();
        if (!item1.isEmpty()) {
            matrices.push();
            matrices.translate(0.5f, 0.58f, 0.5f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
                matrices.translate(0f, -0.06f, 0f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
                matrices.translate(0f, -0.25f, 0f);
            matrices.scale(1f, 1f, 1f);
            matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
            matrices.translate(0.0f, 0.0f, -0.4f);
            matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
            MinecraftClient.getInstance().getItemRenderer().renderItem(item1, ModelTransformation.Mode.GROUND, lightAtBlock, overlay, matrices, vertexConsumers, 0);
            matrices.pop();
        }
        if (!item2.isEmpty() && !item2.isIn(ItemTags.LOGS_THAT_BURN) && !item2.isIn(ItemTags.PLANKS)) {
            matrices.push();
            matrices.translate(0.5f, 0.08f, 0.5f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
                matrices.translate(0f, 0.06f, 0f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
                matrices.translate(0f, 0.24f, 0f);
            matrices.scale(1f, 1f, 1f);
            matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
            matrices.translate(0.0f, 0.0f, -0.4f);
            matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
            MinecraftClient.getInstance().getItemRenderer().renderItem(item2, ModelTransformation.Mode.GROUND, lightAtBlock, overlay, matrices, vertexConsumers, 0);
            matrices.pop();
        } else if (!item2.isEmpty()) {
            matrices.push();
            BlockState state = Block.getBlockFromItem(item2.getItem()).getDefaultState();
            Sprite texture = MinecraftClient.getInstance().getBlockRenderManager().getModel(state).getParticleSprite();
            VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(spriteToTexture(texture)));
            matrices.translate(0.5f, -1.3f, 0.5f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
                matrices.translate(0f, 0.06f, 0f);
            if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
                matrices.translate(0f, 0.2f, 0f);
            matrices.scale(1f, 1f, 1f);
            matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
            planks.getPart().render(matrices, vertexConsumer, lightAtBlock, overlay);
            matrices.pop();
        }
    }
}
Also used : Sprite(net.minecraft.client.texture.Sprite) VertexConsumer(net.minecraft.client.render.VertexConsumer) ItemStack(net.minecraft.item.ItemStack)

Example 34 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project winterly by tyap-lyap.

the class SantaHatRenderer method render.

@Override
public void render(BipedEntityModel<?> contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
    WinterlyModels.SANTA_HAT_MODEL.hat.copyTransform(contextModel.head);
    VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(WinterlyMod.locate("textures/entity/" + texture + ".png")));
    WinterlyModels.SANTA_HAT_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 35 with VertexConsumer

use of net.minecraft.client.render.VertexConsumer in project winterly by tyap-lyap.

the class ScarfRenderer method render.

@Override
public void render(BipedEntityModel<?> contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
    WinterlyModels.SCARF_MODEL.scarf.copyTransform(contextModel.body);
    VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(WinterlyMod.locate("textures/entity/" + texture + ".png")));
    WinterlyModels.SCARF_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
}
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