当前位置: 首页>>代码示例>>Java>>正文


Java TextureAtlasSprite.getMaxV方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.texture.TextureAtlasSprite.getMaxV方法的典型用法代码示例。如果您正苦于以下问题:Java TextureAtlasSprite.getMaxV方法的具体用法?Java TextureAtlasSprite.getMaxV怎么用?Java TextureAtlasSprite.getMaxV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.texture.TextureAtlasSprite的用法示例。


在下文中一共展示了TextureAtlasSprite.getMaxV方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawFluidTexture

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
private static void drawFluidTexture(double xCoord, double yCoord, TextureAtlasSprite textureSprite, int maskTop, int maskRight, double zLevel) {
    double uMin = textureSprite.getMinU();
    double uMax = textureSprite.getMaxU();
    double vMin = textureSprite.getMinV();
    double vMax = textureSprite.getMaxV();
    uMax = uMax - maskRight / 16.0 * (uMax - uMin);
    vMax = vMax - maskTop / 16.0 * (vMax - vMin);

    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder worldrenderer = tessellator.getBuffer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(xCoord, yCoord + 16, zLevel).tex(uMin, vMax).endVertex();
    worldrenderer.pos(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex(uMax, vMax).endVertex();
    worldrenderer.pos(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex(uMax, vMin).endVertex();
    worldrenderer.pos(xCoord, yCoord + maskTop, zLevel).tex(uMin, vMin).endVertex();
    tessellator.draw();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:18,代码来源:GuiUtils.java

示例2: func_178108_a

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
private void func_178108_a(float p_178108_1_, TextureAtlasSprite p_178108_2_)
{
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = 0.1F;
    GlStateManager.color(0.1F, 0.1F, 0.1F, 0.5F);
    GlStateManager.pushMatrix();
    float f1 = -1.0F;
    float f2 = 1.0F;
    float f3 = -1.0F;
    float f4 = 1.0F;
    float f5 = -0.5F;
    float f6 = p_178108_2_.getMinU();
    float f7 = p_178108_2_.getMaxU();
    float f8 = p_178108_2_.getMinV();
    float f9 = p_178108_2_.getMaxV();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(-1.0D, -1.0D, -0.5D).tex((double)f7, (double)f9).endVertex();
    worldrenderer.pos(1.0D, -1.0D, -0.5D).tex((double)f6, (double)f9).endVertex();
    worldrenderer.pos(1.0D, 1.0D, -0.5D).tex((double)f6, (double)f8).endVertex();
    worldrenderer.pos(-1.0D, 1.0D, -0.5D).tex((double)f7, (double)f8).endVertex();
    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:ItemRenderer.java

示例3: renderPortal

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
protected void renderPortal(float timeInPortal, ScaledResolution scaledRes)
{
    if (timeInPortal < 1.0F)
    {
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.PORTAL.getDefaultState());
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMinV();
    float f2 = textureatlassprite.getMaxU();
    float f3 = textureatlassprite.getMaxV();
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:GuiIngame.java

示例4: renderBlockInHand

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Render the block in the player's hand
 */
private void renderBlockInHand(float partialTicks, TextureAtlasSprite atlas)
{
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    float f = 0.1F;
    GlStateManager.color(0.1F, 0.1F, 0.1F, 0.5F);
    GlStateManager.pushMatrix();
    float f1 = -1.0F;
    float f2 = 1.0F;
    float f3 = -1.0F;
    float f4 = 1.0F;
    float f5 = -0.5F;
    float f6 = atlas.getMinU();
    float f7 = atlas.getMaxU();
    float f8 = atlas.getMinV();
    float f9 = atlas.getMaxV();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(-1.0D, -1.0D, -0.5D).tex((double)f7, (double)f9).endVertex();
    vertexbuffer.pos(1.0D, -1.0D, -0.5D).tex((double)f6, (double)f9).endVertex();
    vertexbuffer.pos(1.0D, 1.0D, -0.5D).tex((double)f6, (double)f8).endVertex();
    vertexbuffer.pos(-1.0D, 1.0D, -0.5D).tex((double)f7, (double)f8).endVertex();
    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:30,代码来源:ItemRenderer.java

示例5: func_180474_b

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_)
{
    if (p_180474_1_ < 1.0F)
    {
        p_180474_1_ = p_180474_1_ * p_180474_1_;
        p_180474_1_ = p_180474_1_ * p_180474_1_;
        p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.portal.getDefaultState());
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMinV();
    float f2 = textureatlassprite.getMaxU();
    float f3 = textureatlassprite.getMaxV();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(0.0D, (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
    worldrenderer.pos((double)p_180474_2_.getScaledWidth(), (double)p_180474_2_.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
    worldrenderer.pos((double)p_180474_2_.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
    worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:GuiIngame.java

示例6: isFullSprite

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
private boolean isFullSprite(BakedQuad p_isFullSprite_1_)
{
    TextureAtlasSprite textureatlassprite = p_isFullSprite_1_.getSprite();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = f1 - f;
    float f3 = f2 / 256.0F;
    float f4 = textureatlassprite.getMinV();
    float f5 = textureatlassprite.getMaxV();
    float f6 = f5 - f4;
    float f7 = f6 / 256.0F;
    int[] aint = p_isFullSprite_1_.getVertexData();
    int i = aint.length / 4;

    for (int j = 0; j < 4; ++j)
    {
        int k = j * i;
        float f8 = Float.intBitsToFloat(aint[k + 4]);
        float f9 = Float.intBitsToFloat(aint[k + 4 + 1]);

        if (!this.equalsDelta(f8, f, f3) && !this.equalsDelta(f8, f1, f3))
        {
            return false;
        }

        if (!this.equalsDelta(f9, f4, f7) && !this.equalsDelta(f9, f5, f7))
        {
            return false;
        }
    }

    return true;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:NaturalProperties.java

示例7: doRender

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.fire_charge);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    worldrenderer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    worldrenderer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:RenderFireball.java

示例8: renderPortal

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
private void renderPortal(float timeInPortal, ScaledResolution scaledRes)
{
    if (timeInPortal < 1.0F)
    {
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * timeInPortal;
        timeInPortal = timeInPortal * 0.8F + 0.2F;
    }

    GlStateManager.disableAlpha();
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
    this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.PORTAL.getDefaultState());
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMinV();
    float f2 = textureatlassprite.getMaxU();
    float f3 = textureatlassprite.getMaxV();
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
    vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:GuiIngame.java

示例9: getInterpV

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
public static float getInterpV(float v, TextureAtlasSprite tex) {
	float f = tex.getMaxV() - tex.getMinV();
	return tex.getMinV() + f * (float) v / tex.getIconHeight();
}
 
开发者ID:oMilkyy,项目名称:SimpleTubes,代码行数:5,代码来源:ModelFactory.java

示例10: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F)
    {
        TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
        this.bindTexture(TextureMap.locationBlocksTexture);
        float f6 = textureatlassprite2.getMinU();
        float f7 = textureatlassprite2.getMinV();
        float f8 = textureatlassprite2.getMaxU();
        float f9 = textureatlassprite2.getMaxV();

        if (i / 2 % 2 == 0)
        {
            float f10 = f8;
            f8 = f6;
            f6 = f10;
        }

        worldrenderer.pos((double)(f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
        worldrenderer.pos((double)(-f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
        worldrenderer.pos((double)(f1 - f2), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
        ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:58,代码来源:Render.java

示例11: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Renders a layer of fire on top of an entity.
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks)
{
    GlStateManager.disableLighting();
    TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
    TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
    TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = entity.width * 1.4F;
    GlStateManager.scale(f, f, f);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = entity.height / f;
    float f4 = (float)(entity.posY - entity.getEntityBoundingBox().minY);
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(0.0F, 0.0F, -0.3F + (float)((int)f3) * 0.02F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f5 = 0.0F;
    int i = 0;
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);

    while (f3 > 0.0F)
    {
        TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
        this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        float f6 = textureatlassprite2.getMinU();
        float f7 = textureatlassprite2.getMinV();
        float f8 = textureatlassprite2.getMaxU();
        float f9 = textureatlassprite2.getMaxV();

        if (i / 2 % 2 == 0)
        {
            float f10 = f8;
            f8 = f6;
            f6 = f10;
        }

        vertexbuffer.pos((double)(f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f8, (double)f9).endVertex();
        vertexbuffer.pos((double)(-f1 - 0.0F), (double)(0.0F - f4), (double)f5).tex((double)f6, (double)f9).endVertex();
        vertexbuffer.pos((double)(-f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f6, (double)f7).endVertex();
        vertexbuffer.pos((double)(f1 - 0.0F), (double)(1.4F - f4), (double)f5).tex((double)f8, (double)f7).endVertex();
        f3 -= 0.45F;
        f4 -= 0.45F;
        f1 *= 0.9F;
        f5 += 0.03F;
        ++i;
    }

    tessellator.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:58,代码来源:Render.java

示例12: renderFireInFirstPerson

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Renders the fire on the screen for first person mode. Arg: partialTickTime
 */
private void renderFireInFirstPerson(float p_78442_1_)
{
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F);
    GlStateManager.depthFunc(519);
    GlStateManager.depthMask(false);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    float f = 1.0F;

    for (int i = 0; i < 2; ++i)
    {
        GlStateManager.pushMatrix();
        TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/fire_layer_1");
        this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
        float f1 = textureatlassprite.getMinU();
        float f2 = textureatlassprite.getMaxU();
        float f3 = textureatlassprite.getMinV();
        float f4 = textureatlassprite.getMaxV();
        float f5 = (0.0F - f) / 2.0F;
        float f6 = f5 + f;
        float f7 = 0.0F - f / 2.0F;
        float f8 = f7 + f;
        float f9 = -0.5F;
        GlStateManager.translate((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
        GlStateManager.rotate((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
        worldrenderer.pos((double)f5, (double)f7, (double)f9).tex((double)f2, (double)f4).endVertex();
        worldrenderer.pos((double)f6, (double)f7, (double)f9).tex((double)f1, (double)f4).endVertex();
        worldrenderer.pos((double)f6, (double)f8, (double)f9).tex((double)f1, (double)f3).endVertex();
        worldrenderer.pos((double)f5, (double)f8, (double)f9).tex((double)f2, (double)f3).endVertex();
        tessellator.draw();
        GlStateManager.popMatrix();
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
    GlStateManager.depthFunc(515);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:45,代码来源:ItemRenderer.java

示例13: renderEntityOnFire

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime
 */
private void renderEntityOnFire(Entity entity, double x, double y, double z, float partialTicks) {
	GlStateManager.disableLighting();
	TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
	TextureAtlasSprite textureatlassprite = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_0");
	TextureAtlasSprite textureatlassprite1 = texturemap.getAtlasSprite("minecraft:blocks/fire_layer_1");
	GlStateManager.pushMatrix();
	GlStateManager.translate((float) x, (float) y, (float) z);
	float f = entity.width * 1.4F;
	GlStateManager.scale(f, f, f);
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	float f1 = 0.5F;
	float f2 = 0.0F;
	float f3 = entity.height / f;
	float f4 = (float) (entity.posY - entity.getEntityBoundingBox().minY);
	GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	GlStateManager.translate(0.0F, 0.0F, -0.3F + (float) ((int) f3) * 0.02F);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	float f5 = 0.0F;
	int i = 0;
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);

	while (f3 > 0.0F) {
		TextureAtlasSprite textureatlassprite2 = i % 2 == 0 ? textureatlassprite : textureatlassprite1;
		this.bindTexture(TextureMap.locationBlocksTexture);
		float f6 = textureatlassprite2.getMinU();
		float f7 = textureatlassprite2.getMinV();
		float f8 = textureatlassprite2.getMaxU();
		float f9 = textureatlassprite2.getMaxV();

		if (i / 2 % 2 == 0) {
			float f10 = f8;
			f8 = f6;
			f6 = f10;
		}

		worldrenderer.pos((double) (f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f8, (double) f9)
				.endVertex();
		worldrenderer.pos((double) (-f1 - f2), (double) (0.0F - f4), (double) f5).tex((double) f6, (double) f9)
				.endVertex();
		worldrenderer.pos((double) (-f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f6, (double) f7)
				.endVertex();
		worldrenderer.pos((double) (f1 - f2), (double) (1.4F - f4), (double) f5).tex((double) f8, (double) f7)
				.endVertex();
		f3 -= 0.45F;
		f4 -= 0.45F;
		f1 *= 0.9F;
		f5 += 0.03F;
		++i;
	}

	tessellator.draw();
	GlStateManager.popMatrix();
	GlStateManager.enableLighting();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:59,代码来源:Render.java

示例14: renderFireInFirstPerson

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
/**
 * Renders the fire on the screen for first person mode. Arg: partialTickTime
 */
private void renderFireInFirstPerson(float partialTicks)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 0.9F);
    GlStateManager.depthFunc(519);
    GlStateManager.depthMask(false);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    float f = 1.0F;

    for (int i = 0; i < 2; ++i)
    {
        GlStateManager.pushMatrix();
        TextureAtlasSprite textureatlassprite = this.mc.getTextureMapBlocks().getAtlasSprite("minecraft:blocks/fire_layer_1");
        this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        float f1 = textureatlassprite.getMinU();
        float f2 = textureatlassprite.getMaxU();
        float f3 = textureatlassprite.getMinV();
        float f4 = textureatlassprite.getMaxV();
        float f5 = -0.5F;
        float f6 = 0.5F;
        float f7 = -0.5F;
        float f8 = 0.5F;
        float f9 = -0.5F;
        GlStateManager.translate((float)(-(i * 2 - 1)) * 0.24F, -0.3F, 0.0F);
        GlStateManager.rotate((float)(i * 2 - 1) * 10.0F, 0.0F, 1.0F, 0.0F);
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
        vertexbuffer.pos(-0.5D, -0.5D, -0.5D).tex((double)f2, (double)f4).endVertex();
        vertexbuffer.pos(0.5D, -0.5D, -0.5D).tex((double)f1, (double)f4).endVertex();
        vertexbuffer.pos(0.5D, 0.5D, -0.5D).tex((double)f1, (double)f3).endVertex();
        vertexbuffer.pos(-0.5D, 0.5D, -0.5D).tex((double)f2, (double)f3).endVertex();
        tessellator.draw();
        GlStateManager.popMatrix();
    }

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
    GlStateManager.depthFunc(515);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:ItemRenderer.java

示例15: renderGuiFluid

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //导入方法依赖的package包/类
public static void renderGuiFluid(FluidStack fluid, float fill, int x, int y, int width, int maxHeight)
{
    if (fluid != null && fluid.getFluid() != null && fluid.amount > 0)
    {
        TextureAtlasSprite sprite = getStillTexture(fluid);
        if (sprite != null)
        {
            int rendHeight = (int) Math.max(Math.min((float) maxHeight, (float) maxHeight * fill), 1.0F);
            int yPos = y + maxHeight - rendHeight;
            Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
            int fluidColor = fluid.getFluid().getColor(fluid);
            GL11.glColor3ub((byte) (fluidColor >> 16 & 255), (byte) (fluidColor >> 8 & 255), (byte) (fluidColor & 255));
            GlStateManager.enableBlend();

            for (int i = 0; i < width; i += 16)
            {
                for (int j = 0; j < rendHeight; j += 16)
                {
                    int dwt = Math.min(width - i, 16);
                    int dht = Math.min(rendHeight - j, 16);
                    int dx = x + i;
                    int dy = yPos + j;
                    double minU = (double) sprite.getMinU();
                    double maxU = (double) sprite.getMaxU();
                    double minV = (double) sprite.getMinV();
                    double maxV = (double) sprite.getMaxV();
                    Tessellator tessellator = Tessellator.getInstance();
                    BufferBuilder tes = tessellator.getBuffer();
                    tes.begin(7, DefaultVertexFormats.POSITION_TEX);
                    tes.pos((double) dx, (double) (dy + dht), 0.0D).tex(minU, minV + (maxV - minV) * (double) dht / 16.0D).endVertex();
                    tes.pos((double) (dx + dwt), (double) (dy + dht), 0.0D).tex(minU + (maxU - minU) * (double) dwt / 16.0D, minV + (maxV - minV) * (double) dht / 16.0D).endVertex();
                    tes.pos((double) (dx + dwt), (double) dy, 0.0D).tex(minU + (maxU - minU) * (double) dwt / 16.0D, minV).endVertex();
                    tes.pos((double) dx, (double) dy, 0.0D).tex(minU, minV).endVertex();
                    tessellator.draw();
                }
            }

            GlStateManager.disableBlend();
        }
    }
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:42,代码来源:RenderHelper.java


注:本文中的net.minecraft.client.renderer.texture.TextureAtlasSprite.getMaxV方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。