當前位置: 首頁>>代碼示例>>Java>>正文


Java TextureAtlasSprite.getMaxU方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureAtlasSprite.getMaxU方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureAtlasSprite.getMaxU方法的具體用法?Java TextureAtlasSprite.getMaxU怎麽用?Java TextureAtlasSprite.getMaxU使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.texture.TextureAtlasSprite的用法示例。


在下文中一共展示了TextureAtlasSprite.getMaxU方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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:Notoh,項目名稱:DecompiledMinecraft,代碼行數:27,代碼來源:ItemRenderer.java

示例2: 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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:30,代碼來源:ItemRenderer.java

示例3: 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:Notoh,項目名稱:DecompiledMinecraft,代碼行數:36,代碼來源:RenderFireball.java

示例4: 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

示例5: 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

示例6: 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:SkidJava,項目名稱:BaseClient,代碼行數:36,代碼來源:GuiIngame.java

示例7: addBitToBuffer

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
private void addBitToBuffer(BufferBuilder buffer, float x, float y, float z, TextureAtlasSprite sprite, int lightx, int lighty) {
	float x1 = x - (1F / 32);
	float y1 = y - (1.5F / 32);
	float z1 = z - (1F / 32);
	float x2 = x + (1F / 32);
	float y2 = y + (1.5F / 32);
	float z2 = z + (1F / 32);
	
	double diffU = sprite.getMaxU() - sprite.getMinU();
	double diffV = sprite.getMaxV() - sprite.getMinV();
	double minU = sprite.getMinU() + diffU * 0;
	double maxU = sprite.getMaxU() - diffU * (1 - 0.125);
	double minV = sprite.getMinV() + diffV * 0.125;
	double maxV = sprite.getMaxV() - diffV * (1 - 0.3125);

	// north
	buffer.pos(x2, y2, z1).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y1, z1).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z1).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y2, z1).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	// south
	buffer.pos(x1, y2, z2).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z2).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y1, z2).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y2, z2).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	// west
	buffer.pos(x1, y2, z1).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z1).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z2).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y2, z2).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	// east
	buffer.pos(x2, y2, z2).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y1, z2).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y1, z1).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y2, z1).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	// down
	minV = sprite.getMinV() + diffV * 0.3125;
	maxV = sprite.getMaxV() - diffV * (1 - 0.4375);
	buffer.pos(x2, y1, z1).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y1, z2).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z2).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y1, z1).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	// up
	minV = sprite.getMinV() + diffV * 0;
	maxV = sprite.getMaxV() - diffV * (1 - 0.125);
	buffer.pos(x1, y2, z1).tex(minU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x1, y2, z2).tex(minU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y2, z2).tex(maxU, maxV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
	buffer.pos(x2, y2, z1).tex(maxU, minV).lightmap(lightx, lighty).color(1F, 1F, 1F, 1F).endVertex();
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:51,代碼來源:TileEntityStabilityProjectorRenderer.java

示例8: doRender

import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
/**
 * Renders the desired {@code T} type Entity.
 */
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();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    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((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:47,代碼來源:RenderFireball.java

示例9: 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

示例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:SkidJava,項目名稱:BaseClient,代碼行數:58,代碼來源:Render.java

示例11: 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:SkidJava,項目名稱:BaseClient,代碼行數:45,代碼來源:ItemRenderer.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 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:F1r3w477,項目名稱:CustomWorldGen,代碼行數:45,代碼來源:ItemRenderer.java

示例13: 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.getMaxU方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。