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


Java Icon.getMaxU方法代码示例

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


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

示例1: func_77026_a

import net.minecraft.util.Icon; //导入方法依赖的package包/类
private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
{
    float f = par2Icon.getMinU();
    float f1 = par2Icon.getMaxU();
    float f2 = par2Icon.getMinV();
    float f3 = par2Icon.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    par1Tessellator.startDrawingQuads();
    par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
    par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
    par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
    par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
    par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
    par1Tessellator.draw();
}
 
开发者ID:marcus8448,项目名称:IceMod,代码行数:20,代码来源:RenderHunkOIce.java

示例2: renderInsideOfBlock

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex
 */
private void renderInsideOfBlock(float par1, Icon par2Icon)
{
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    Tessellator tessellator = Tessellator.instance;
    float f1 = 0.1F;
    GL11.glColor4f(f1, f1, f1, 0.5F);
    GL11.glPushMatrix();
    float f2 = -1.0F;
    float f3 = 1.0F;
    float f4 = -1.0F;
    float f5 = 1.0F;
    float f6 = -0.5F;
    float f7 = par2Icon.getMinU();
    float f8 = par2Icon.getMaxU();
    float f9 = par2Icon.getMinV();
    float f10 = par2Icon.getMaxV();
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV((double)f2, (double)f4, (double)f6, (double)f8, (double)f10);
    tessellator.addVertexWithUV((double)f3, (double)f4, (double)f6, (double)f7, (double)f10);
    tessellator.addVertexWithUV((double)f3, (double)f5, (double)f6, (double)f7, (double)f9);
    tessellator.addVertexWithUV((double)f2, (double)f5, (double)f6, (double)f8, (double)f9);
    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:29,代码来源:ItemRenderer.java

示例3: func_77026_a

import net.minecraft.util.Icon; //导入方法依赖的package包/类
private void func_77026_a(Tessellator model, Icon image)
{
    float f = image.getMinU();
    float f1 = image.getMaxU();
    float f2 = image.getMinV();
    float f3 = image.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    model.startDrawingQuads();
    model.setNormal(0.0F, 1.0F, 0.0F);
    model.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
    model.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
    model.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
    model.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
    model.draw();
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:20,代码来源:RenderBomb.java

示例4: drawCrossedSquares

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Utility function to draw crossed swuares
 */
public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9)
{
    Tessellator tessellator = Tessellator.instance;
    Icon icon = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2);

    if (this.hasOverrideBlockTexture())
    {
        icon = this.overrideBlockTexture;
    }

    double d3 = (double)icon.getMinU();
    double d4 = (double)icon.getMinV();
    double d5 = (double)icon.getMaxU();
    double d6 = (double)icon.getMaxV();
    double d7 = 0.45D * (double)par9;
    double d8 = par3 + 0.5D - d7;
    double d9 = par3 + 0.5D + d7;
    double d10 = par7 + 0.5D - d7;
    double d11 = par7 + 0.5D + d7;
    tessellator.addVertexWithUV(d8, par5 + (double)par9, d10, d3, d4);
    tessellator.addVertexWithUV(d8, par5 + 0.0D, d10, d3, d6);
    tessellator.addVertexWithUV(d9, par5 + 0.0D, d11, d5, d6);
    tessellator.addVertexWithUV(d9, par5 + (double)par9, d11, d5, d4);
    tessellator.addVertexWithUV(d9, par5 + (double)par9, d11, d3, d4);
    tessellator.addVertexWithUV(d9, par5 + 0.0D, d11, d3, d6);
    tessellator.addVertexWithUV(d8, par5 + 0.0D, d10, d5, d6);
    tessellator.addVertexWithUV(d8, par5 + (double)par9, d10, d5, d4);
    tessellator.addVertexWithUV(d8, par5 + (double)par9, d11, d3, d4);
    tessellator.addVertexWithUV(d8, par5 + 0.0D, d11, d3, d6);
    tessellator.addVertexWithUV(d9, par5 + 0.0D, d10, d5, d6);
    tessellator.addVertexWithUV(d9, par5 + (double)par9, d10, d5, d4);
    tessellator.addVertexWithUV(d9, par5 + (double)par9, d10, d3, d4);
    tessellator.addVertexWithUV(d9, par5 + 0.0D, d10, d3, d6);
    tessellator.addVertexWithUV(d8, par5 + 0.0D, d11, d5, d6);
    tessellator.addVertexWithUV(d8, par5 + (double)par9, d11, d5, d4);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:40,代码来源:RenderBlocks.java

示例5: doRenderFireball

import net.minecraft.util.Icon; //导入方法依赖的package包/类
public void doRenderFireball(EntityFlamingPoisonball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    Icon icon = ModItems.FPoisonball.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = icon.getMinU();
    float f4 = icon.getMaxU();
    float f5 = icon.getMinV();
    float f6 = icon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
开发者ID:NovaViper,项目名称:ZeroQuest,代码行数:30,代码来源:RenderFPoisonball.java

示例6: renderPositiveXFace

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the face on the positive x side with optional texture offsets.
 * @param xOffset
 * The offset on the x-axis.
 * @param yOffset
 * The offset on the y-axis.
 * @param zOffset
 * The offset on the z-axis.
 * @param height
 * The faces height.
 * @param depth
 * The faces depth.
 * @param uOffset
 * The texture offset on the u-axis.
 * @param vOffset
 * The texture offset on the v-axis.
 * @param uMaxOffset
 * The max texture offset on the u-axis.
 * @param vMaxOffset
 * The max texture offset on the v-axis.
 * @param icon
 * The faces texture.
 * @param scale
 * The value to scale the offsets with.
 */
public static void renderPositiveXFace(double xOffset, double yOffset, double zOffset, double height, double depth, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale)
{
	tr.setNormal(1f, 0f, 0f);
	
	double x = xBaseCoord + xOffset * scale;

	// bottom right
	double zBr = zBaseCoord + zOffset * scale;
	double yBr = yBaseCoord + yOffset * scale;

	// top right
	double zTr = zBaseCoord + zOffset * scale;
	double yTr = yBaseCoord + (yOffset + height) * scale;

	// top left
	double zTl = zBaseCoord + (zOffset + depth) * scale;
	double yTl = yBaseCoord + (yOffset + height) * scale;
	
	// bottom left
	double zBl = zBaseCoord + (zOffset + depth) * scale;
	double yBl = yBaseCoord + yOffset * scale;
	
	double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU();
	double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU();
	double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV();
	double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV();
	
	// bottom right
	tr.addVertexWithUV(x, yBr, zBr, maxU, maxV);
	// top right
	tr.addVertexWithUV(x, yTr, zTr, maxU, minV);
	// top left
	tr.addVertexWithUV(x, yTl, zTl, minU, minV);
	// bottom left
	tr.addVertexWithUV(x, yBl, zBl, minU, maxV);
}
 
开发者ID:BraynStorm,项目名称:FlowCraft,代码行数:62,代码来源:TessellationManager.java

示例7: func_130015_b

import net.minecraft.util.Icon; //导入方法依赖的package包/类
protected void func_130015_b(float par1, int par2, int par3)
{
    if (par1 < 1.0F)
    {
        par1 *= par1;
        par1 *= par1;
        par1 = par1 * 0.8F + 0.2F;
    }

    GL11.glDisable(GL11.GL_ALPHA_TEST);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, par1);
    Icon icon = Block.portal.getBlockTextureFromSide(1);
    this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
    float f1 = icon.getMinU();
    float f2 = icon.getMinV();
    float f3 = icon.getMaxU();
    float f4 = icon.getMaxV();
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(0.0D, (double)par3, -90.0D, (double)f1, (double)f4);
    tessellator.addVertexWithUV((double)par2, (double)par3, -90.0D, (double)f3, (double)f4);
    tessellator.addVertexWithUV((double)par2, 0.0D, -90.0D, (double)f3, (double)f2);
    tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, (double)f1, (double)f2);
    tessellator.draw();
    GL11.glDepthMask(true);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:33,代码来源:GuiIngame.java

示例8: renderPositiveYFace

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the face on the positive y side with optional texture offsets.
 * @param xOffset
 * The offset on the x-axis.
 * @param yOffset
 * The offset on the y-axis.
 * @param zOffset
 * The offset on the z-axis.
 * @param width
 * The faces width.
 * @param depth
 * The faces depth.
 * @param uOffset
 * The texture offset on the u-axis.
 * @param vOffset
 * The texture offset on the v-axis.
 * @param uMaxOffset
 * The max texture offset on the u-axis.
 * @param vMaxOffset
 * The max texture offset on the v-axis.
 * @param icon
 * The faces texture.
 * @param scale
 * The value to scale the offsets with.
 */
public static void renderPositiveYFace(double xOffset, double yOffset, double zOffset, double width, double depth, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale)
{
	tr.setNormal(0f, 1f, 0f);
	
	double y = yBaseCoord + yOffset * scale;

	// bottom right
	double xBr = xBaseCoord + xOffset * scale;
	double zBr = zBaseCoord + zOffset * scale;

	// top right
	double xTr = xBaseCoord + xOffset * scale;
	double zTr = zBaseCoord + (zOffset + depth) * scale;
	
	// top left
	double xTl = xBaseCoord + (xOffset + width) * scale;
	double zTl = zBaseCoord + (zOffset + depth) * scale;
	
	// bottom left
	double xBl = xBaseCoord + (xOffset + width) * scale;
	double zBl = zBaseCoord + zOffset * scale;
	
	double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU();
	double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU();
	double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV();
	double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV();
	
	// bottom right
	tr.addVertexWithUV(xBr, y, zBr, maxU, maxV);
	// top right
	tr.addVertexWithUV(xTr, y, zTr, maxU, minV);
	// top left
	tr.addVertexWithUV(xTl, y, zTl, minU, minV);
	// bottom left
	tr.addVertexWithUV(xBl, y, zBl, minU, maxV);
}
 
开发者ID:BraynStorm,项目名称:FlowCraft,代码行数:62,代码来源:TessellationManager.java

示例9: renderNegativeYFace

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the face on the negative y side with optional texture offsets.
 * @param xOffset
 * The offset on the x-axis.
 * @param yOffset
 * The offset on the y-axis.
 * @param zOffset
 * The offset on the z-axis.
 * @param width
 * The faces width.
 * @param depth
 * The faces depth.
 * @param uOffset
 * The texture offset on the u-axis.
 * @param vOffset
 * The texture offset on the v-axis.
 * @param uMaxOffset
 * The max texture offset on the u-axis.
 * @param vMaxOffset
 * The max texture offset on the v-axis.
 * @param icon
 * The faces texture.
 * @param scale
 * The value to scale the offsets with.
 */
public static void renderNegativeYFace(double xOffset, double yOffset, double zOffset, double width, double depth, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale)
{
	tr.setNormal(0f, -1f, 0f);
	
	double y = yBaseCoord + yOffset * scale;
	
	// top right
	double xTr = xBaseCoord + xOffset * scale;
	double zTr = zBaseCoord + zOffset * scale;

	// top left
	double xTl = xBaseCoord + (xOffset + width) * scale;
	double zTl = zBaseCoord + zOffset * scale;
	
	// bottom left
	double xBl = xBaseCoord + (xOffset + width) * scale;
	double zBl = zBaseCoord + (zOffset + depth) * scale;

	// bottom right
	double xBr = xBaseCoord + xOffset * scale;
	double zBr = zBaseCoord + (zOffset + depth) * scale;
	
	double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU();
	double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU();
	double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV();
	double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV();
	
	// top right
	tr.addVertexWithUV(xTr, y, zTr, maxU, minV);
	// top left
	tr.addVertexWithUV(xTl, y, zTl, minU, minV);
	// bottom left
	tr.addVertexWithUV(xBl, y, zBl, minU, maxV);
	// bottom right
	tr.addVertexWithUV(xBr, y, zBr, maxU, maxV);
}
 
开发者ID:BraynStorm,项目名称:FlowCraft,代码行数:62,代码来源:TessellationManager.java

示例10: renderPositiveZFace

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the face on the positive z side with optional texture offsets.
 * @param xOffset
 * The offset on the x-axis.
 * @param yOffset
 * The offset on the y-axis.
 * @param zOffset
 * The offset on the z-axis.
 * @param width
 * The faces width.
 * @param height
 * The faces height.
 * @param uOffset
 * The texture offset on the u-axis.
 * @param vOffset
 * The texture offset on the v-axis.
 * @param uMaxOffset
 * The max texture offset on the u-axis.
 * @param vMaxOffset
 * The max texture offset on the v-axis.
 * @param icon
 * The faces texture.
 * @param scale
 * The value to scale the offsets with.
 */
public static void renderPositiveZFace(double xOffset, double yOffset, double zOffset, double width, double height, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale)
{
	tr.setNormal(0f, 0f, 1f);
	
	double z = zBaseCoord + zOffset * scale;
	
	// bottom left
	double xBl = xBaseCoord + xOffset * scale;
	double yBl = yBaseCoord + yOffset * scale;

	// bottom right
	double xBr = xBaseCoord + (xOffset + width) * scale;
	double yBr = yBaseCoord + yOffset * scale;

	// top right
	double xTr = xBaseCoord + (xOffset + width) * scale;
	double yTr = yBaseCoord + (yOffset + height) * scale;

	// top left
	double xTl = xBaseCoord + xOffset * scale;
	double yTl = yBaseCoord + (yOffset + height) * scale;
	
	double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU();
	double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU();
	double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV();
	double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV();
	
	// bottom left
	tr.addVertexWithUV(xBl, yBl, z, minU, maxV);
	// bottom right
	tr.addVertexWithUV(xBr, yBr, z, maxU, maxV);
	// top right
	tr.addVertexWithUV(xTr, yTr, z, maxU, minV);
	// top left
	tr.addVertexWithUV(xTl, yTl, z, minU, minV);
}
 
开发者ID:BraynStorm,项目名称:FlowCraft,代码行数:62,代码来源:TessellationManager.java

示例11: renderNegativeZFace

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Renders the face on the negative z side with optional texture offsets.
 * @param xOffset
 * The offset on the x-axis.
 * @param yOffset
 * The offset on the y-axis.
 * @param zOffset
 * The offset on the z-axis.
 * @param width
 * The faces width.
 * @param height
 * The faces height.
 * @param uOffset
 * The texture offset on the u-axis.
 * @param vOffset
 * The texture offset on the v-axis.
 * @param uMaxOffset
 * The max texture offset on the u-axis.
 * @param vMaxOffset
 * The max texture offset on the v-axis.
 * @param icon
 * The faces texture.
 * @param scale
 * The value to scale the offsets with.
 */
public static void renderNegativeZFace(double xOffset, double yOffset, double zOffset, double width, double height, double uOffset, double vOffset, double uMaxOffset, double vMaxOffset, Icon icon, double scale)
{
	tr.setNormal(0f, 0f, -1f);
	
	double z = zBaseCoord + zOffset * scale;

	// bottom right
	double xBr = xBaseCoord + xOffset * scale;
	double yBr = yBaseCoord + yOffset * scale;

	// top right
	double xTr = xBaseCoord + xOffset * scale;
	double yTr = yBaseCoord + (yOffset + height) * scale;

	// top left
	double xTl = xBaseCoord + (xOffset + width) * scale;
	double yTl = yBaseCoord + (yOffset + height) * scale;
	
	// bottom left
	double xBl = xBaseCoord + (xOffset + width) * scale;
	double yBl = yBaseCoord + yOffset * scale;
	
	double minU = (uOffset > 0 && uOffset < 16) ? icon.getMinU() + (icon.getInterpolatedU(uOffset) - icon.getMinU()) : icon.getMinU();
	double maxU = (uMaxOffset > 0 && uMaxOffset < 16) ? icon.getMaxU() - (icon.getMaxU() - icon.getInterpolatedU(uMaxOffset)) : icon.getMaxU();
	double minV = (vOffset > 0 && vOffset < 16) ? icon.getMinV() + (icon.getInterpolatedV(vOffset) - icon.getMinV()) : icon.getMinV();
	double maxV = (vMaxOffset > 0 && vMaxOffset < 16) ? icon.getMaxV() - (icon.getMaxV() - icon.getInterpolatedV(vMaxOffset)) : icon.getMaxV();
	
	// bottom right
	tr.addVertexWithUV(xBr, yBr, z, maxU, maxV);
	// top right
	tr.addVertexWithUV(xTr, yTr, z, maxU, minV);
	// top left
	tr.addVertexWithUV(xTl, yTl, z, minU, minV);
	// bottom left
	tr.addVertexWithUV(xBl, yBl, z, minU, maxV);
}
 
开发者ID:BraynStorm,项目名称:FlowCraft,代码行数:62,代码来源:TessellationManager.java

示例12: doRenderFireball

import net.minecraft.util.Icon; //导入方法依赖的package包/类
public void doRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
{
    GL11.glPushMatrix();
    this.bindEntityTexture(par1EntityFireball);
    GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    float f2 = this.field_77002_a;
    GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
    Icon icon = Item.fireballCharge.getIconFromDamage(0);
    Tessellator tessellator = Tessellator.instance;
    float f3 = icon.getMinU();
    float f4 = icon.getMaxU();
    float f5 = icon.getMinV();
    float f6 = icon.getMaxV();
    float f7 = 1.0F;
    float f8 = 0.5F;
    float f9 = 0.25F;
    GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(0.0F - f9), 0.0D, (double)f3, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(0.0F - f9), 0.0D, (double)f4, (double)f6);
    tessellator.addVertexWithUV((double)(f7 - f8), (double)(1.0F - f9), 0.0D, (double)f4, (double)f5);
    tessellator.addVertexWithUV((double)(0.0F - f8), (double)(1.0F - f9), 0.0D, (double)f3, (double)f5);
    tessellator.draw();
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:30,代码来源:RenderFireball.java

示例13: renderBlockLilyPad

import net.minecraft.util.Icon; //导入方法依赖的package包/类
/**
 * Render BlockLilyPad
 */
public boolean renderBlockLilyPad(Block par1Block, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    Icon icon = this.getBlockIconFromSide(par1Block, 1);

    if (this.hasOverrideBlockTexture())
    {
        icon = this.overrideBlockTexture;
    }

    float f = 0.015625F;
    double d0 = (double)icon.getMinU();
    double d1 = (double)icon.getMinV();
    double d2 = (double)icon.getMaxU();
    double d3 = (double)icon.getMaxV();
    long l = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3;
    l = l * l * 42317861L + l * 11L;
    int i1 = (int)(l >> 16 & 3L);
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    float f1 = (float)par2 + 0.5F;
    float f2 = (float)par4 + 0.5F;
    float f3 = (float)(i1 & 1) * 0.5F * (float)(1 - i1 / 2 % 2 * 2);
    float f4 = (float)(i1 + 1 & 1) * 0.5F * (float)(1 - (i1 + 1) / 2 % 2 * 2);
    tessellator.setColorOpaque_I(par1Block.getBlockColor());
    tessellator.addVertexWithUV((double)(f1 + f3 - f4), (double)((float)par3 + f), (double)(f2 + f3 + f4), d0, d1);
    tessellator.addVertexWithUV((double)(f1 + f3 + f4), (double)((float)par3 + f), (double)(f2 - f3 + f4), d2, d1);
    tessellator.addVertexWithUV((double)(f1 - f3 + f4), (double)((float)par3 + f), (double)(f2 - f3 - f4), d2, d3);
    tessellator.addVertexWithUV((double)(f1 - f3 - f4), (double)((float)par3 + f), (double)(f2 + f3 - f4), d0, d3);
    tessellator.setColorOpaque_I((par1Block.getBlockColor() & 16711422) >> 1);
    tessellator.addVertexWithUV((double)(f1 - f3 - f4), (double)((float)par3 + f), (double)(f2 + f3 - f4), d0, d3);
    tessellator.addVertexWithUV((double)(f1 - f3 + f4), (double)((float)par3 + f), (double)(f2 - f3 - f4), d2, d3);
    tessellator.addVertexWithUV((double)(f1 + f3 + f4), (double)((float)par3 + f), (double)(f2 - f3 + f4), d2, d1);
    tessellator.addVertexWithUV((double)(f1 + f3 - f4), (double)((float)par3 + f), (double)(f2 + f3 + f4), d0, d1);
    return true;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:39,代码来源:RenderBlocks.java

示例14: renderItemIn3D

import net.minecraft.util.Icon; //导入方法依赖的package包/类
private void renderItemIn3D(ItemStack stack, Icon icon, int colour, boolean held) {
    GL11.glPushMatrix();
    
    float red = (float)(colour >> 16 & 255) / 255.0F;
    float green = (float)(colour >> 8 & 255) / 255.0F;
    float blue = (float)(colour & 255) / 255.0F;
    
    GL11.glColor4f(red, green, blue, 1.0F);
    
    ItemStack item = stack;
	if(ItemHotItem.getItem(stack) != null)
	{
		item = ItemHotItem.getItem(stack);
	}
	
	float scale = 1.0F;
    Minecraft mc = FMLClientHandler.instance().getClient();
    mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
    Tessellator tessellator = Tessellator.instance;
    float x1 = icon.getMinU();
    float x2 = icon.getMaxU();
    float y1 = icon.getMinV();
    float y2 = icon.getMaxV();
    
    float xOffset = 0.15F+(0.5F * (scale - 1));
    float yOffset = 0.15F-(0.5F * (scale - 1));
    
    if(held)
    {
    	xOffset += 0.5F;
    }
    float xPos = 0.0F+xOffset-yOffset;
    float yPos = 0.3F-xOffset-yOffset;
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glTranslatef(-xPos, -yPos, 0.0F);
    GL11.glScalef(scale, scale, 1);
    ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);

    if (item != null && item.isItemEnchanted()) {
        GL11.glDepthFunc(GL11.GL_EQUAL);
        GL11.glDisable(GL11.GL_LIGHTING);
        mc.renderEngine.bindTexture(TextureHelperMF.ITEM_GLINT);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
        float var13 = 0.76F;
        GL11.glColor4f(0.5F * var13, 0.25F * var13, 0.8F * var13, 1.0F);
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        float var14 = 0.125F;
        GL11.glScalef(var14, var14, var14);
        float var15 = (float) (System.currentTimeMillis() % 3000L) / 3000.0F * 8.0F;
        GL11.glTranslatef(var15, 0.0F, 0.0F);
        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
        GL11.glPopMatrix();
        GL11.glPushMatrix();
        GL11.glScalef(var14, var14, var14);
        var15 = (float) (System.currentTimeMillis() % 4873L) / 4873.0F * 8.0F;
        GL11.glTranslatef(-var15, 0.0F, 0.0F);
        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
        ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
        GL11.glPopMatrix();
        GL11.glMatrixMode(GL11.GL_MODELVIEW);
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glDepthFunc(GL11.GL_LEQUAL);
    }
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);

    GL11.glPopMatrix();

}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:73,代码来源:RenderTongs.java

示例15: renderIcon

import net.minecraft.util.Icon; //导入方法依赖的package包/类
private void renderIcon(Minecraft mc, ItemStack item, Tessellator tessellator, Icon icon, float scale) 
   {
   	float x1 = icon.getMinU();
       float x2 = icon.getMaxU();
       float y1 = icon.getMinV();
       float y2 = icon.getMaxV();
       float var10 = 0.0F;
       float var11 = 0.3F;
       GL11.glEnable(GL12.GL_RESCALE_NORMAL);
       /*
       GL11.glTranslatef(-var10, -var11, 0.0F);
       float var12 = 1.5F;
       GL11.glScalef(var12, var12, var12);
       GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
       GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
       GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
        */


       GL11.glScalef(scale, scale, scale);
       ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, (int)(icon.getIconWidth()), (int)(icon.getIconHeight()), 0.0625F);

       if (item != null && item.isItemEnchanted()) {
           GL11.glDepthFunc(GL11.GL_EQUAL);
           GL11.glDisable(GL11.GL_LIGHTING);
           mc.renderEngine.bindTexture(TextureHelperMF.ITEM_GLINT);
           GL11.glEnable(GL11.GL_BLEND);
           GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
           float var13 = 0.76F;
           GL11.glColor4f(0.5F * var13, 0.25F * var13, 0.8F * var13, 1.0F);
           GL11.glMatrixMode(GL11.GL_TEXTURE);
           GL11.glPushMatrix();
           float var14 = 0.125F;
           GL11.glScalef(var14, var14, var14);
           float var15 = (float) (System.currentTimeMillis() % 3000L) / 3000.0F * 8.0F;
           GL11.glTranslatef(var15, 0.0F, 0.0F);
           GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
           ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, (int)(icon.getIconWidth()*scale), (int)(icon.getIconHeight()*scale), 0.0625F);
           GL11.glPopMatrix();
           GL11.glPushMatrix();
           GL11.glScalef(var14, var14, var14);
           var15 = (float) (System.currentTimeMillis() % 4873L) / 4873.0F * 8.0F;
           GL11.glTranslatef(-var15, 0.0F, 0.0F);
           GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
           ItemRenderer.renderItemIn2D(tessellator, x2, y1, x1, y2, (int)(icon.getIconWidth()*scale), (int)(icon.getIconHeight()*scale), 0.0625F);
           GL11.glPopMatrix();
           GL11.glMatrixMode(GL11.GL_MODELVIEW);
           GL11.glDisable(GL11.GL_BLEND);
           GL11.glEnable(GL11.GL_LIGHTING);
           GL11.glDepthFunc(GL11.GL_LEQUAL);
       }

       GL11.glDisable(GL12.GL_RESCALE_NORMAL);

}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:56,代码来源:RenderCrossbow.java


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