本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureAtlasSprite.getMinU方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureAtlasSprite.getMinU方法的具體用法?Java TextureAtlasSprite.getMinU怎麽用?Java TextureAtlasSprite.getMinU使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.texture.TextureAtlasSprite
的用法示例。
在下文中一共展示了TextureAtlasSprite.getMinU方法的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();
}
示例2: drawTexturedModalRect
import net.minecraft.client.renderer.texture.TextureAtlasSprite; //導入方法依賴的package包/類
public static void drawTexturedModalRect(int x, int y, TextureAtlasSprite sprite, int width, int height) {
float zLevel = 0.01f;
float f = (1/256.0f);
float f1 = (1/256.0f);
float u1 = sprite.getMinU();
float v1 = sprite.getMinV();
float u2 = sprite.getMaxU();
float v2 = sprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer buffer = tessellator.getBuffer();
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buffer.pos((x + 0), (y + height), zLevel).tex(u1, v1).endVertex();
buffer.pos((x + width), (y + height), zLevel).tex(u1, v2).endVertex();
buffer.pos((x + width), (y + 0), zLevel).tex(u2, v2).endVertex();
buffer.pos((x + 0), (y + 0), zLevel).tex(u2, v1).endVertex();
tessellator.draw();
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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;
}
示例9: 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);
}
示例10: 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);
}
示例11: 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();
}
示例12: 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();
}
示例13: 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);
}
示例14: 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();
}
示例15: 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);
}