Search in sources :

Example 6 with MatrixStack

use of com.mojang.blaze3d.matrix.MatrixStack in project NetherEx by LogicTechCorp.

the class RenderEventHandler method renderThirdPersonBlueFire.

private static void renderThirdPersonBlueFire(MatrixStack matrixStack, IRenderTypeBuffer buffer, Entity entity) {
    TextureAtlasSprite blueFireLayerOSprite = BLUE_FIRE_LAYER_O.getSprite();
    TextureAtlasSprite blueFireLayer1Sprite = BLUE_FIRE_LAYER_1.getSprite();
    matrixStack.push();
    float f = entity.getWidth() * 1.4F;
    matrixStack.scale(f, f, f);
    float f1 = 0.5F;
    float f3 = entity.getHeight() / f;
    float f4 = 0.0F;
    matrixStack.rotate(Vector3f.YP.rotationDegrees(-MINECRAFT.getRenderManager().info.getYaw()));
    matrixStack.translate(0.0D, 0.0D, (-0.3F + (float) ((int) f3) * 0.02F));
    float f5 = 0.0F;
    int i = 0;
    IVertexBuilder builder = buffer.getBuffer(Atlases.getCutoutBlockType());
    for (MatrixStack.Entry matrixEntry = matrixStack.getLast(); f3 > 0.0F; i++) {
        TextureAtlasSprite sprite = i % 2 == 0 ? blueFireLayerOSprite : blueFireLayer1Sprite;
        float minU = sprite.getMinU();
        float minV = sprite.getMinV();
        float maxU = sprite.getMaxU();
        float maxV = sprite.getMaxV();
        if (i / 2 % 2 == 0) {
            float f10 = maxU;
            maxU = minU;
            minU = f10;
        }
        fireVertex(matrixEntry, builder, f1 - 0.0F, 0.0F - f4, f5, maxU, maxV);
        fireVertex(matrixEntry, builder, -f1 - 0.0F, 0.0F - f4, f5, minU, maxV);
        fireVertex(matrixEntry, builder, -f1 - 0.0F, 1.4F - f4, f5, minU, minV);
        fireVertex(matrixEntry, builder, f1 - 0.0F, 1.4F - f4, f5, maxU, minV);
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
    }
    matrixStack.pop();
}
Also used : TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) MatrixStack(com.mojang.blaze3d.matrix.MatrixStack) IVertexBuilder(com.mojang.blaze3d.vertex.IVertexBuilder)

Aggregations

MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)6 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Maps (com.google.common.collect.Maps)1 AgriCraft (com.infinityraider.agricraft.AgriCraft)1 AgriApi (com.infinityraider.agricraft.api.v1.AgriApi)1 IMagnifyingGlassInspector (com.infinityraider.agricraft.api.v1.client.IMagnifyingGlassInspector)1 IAgriGrowthStage (com.infinityraider.agricraft.api.v1.crop.IAgriGrowthStage)1 IAgriPlant (com.infinityraider.agricraft.api.v1.plant.IAgriPlant)1 AgriSeason (com.infinityraider.agricraft.api.v1.requirement.AgriSeason)1 IAgriGrowthRequirement (com.infinityraider.agricraft.api.v1.requirement.IAgriGrowthRequirement)1 IAgriSoil (com.infinityraider.agricraft.api.v1.requirement.IAgriSoil)1 AgriItemRegistry (com.infinityraider.agricraft.content.AgriItemRegistry)1 AgriToolTips (com.infinityraider.agricraft.reference.AgriToolTips)1 IRenderUtilities (com.infinityraider.infinitylib.render.IRenderUtilities)1 IVertexBuilder (com.mojang.blaze3d.vertex.IVertexBuilder)1 java.util (java.util)1 BooleanSupplier (java.util.function.BooleanSupplier)1