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


Java IIcon.getInterpolatedV方法代码示例

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


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

示例1: getV

import net.minecraft.util.IIcon; //导入方法依赖的package包/类
public float getV(final int i, final IIcon texture, final int rotation, final float[] u, final float[] v) {
    switch (rotation % 4) {
        case 0: {
            return texture.getInterpolatedV((double)(v[i % 4] * 16.0f));
        }
        case 1: {
            return texture.getInterpolatedV((double)(16.0f - u[i % 4] * 16.0f));
        }
        case 2: {
            return texture.getInterpolatedV((double)(16.0f - v[i % 4] * 16.0f));
        }
        case 3: {
            return texture.getInterpolatedV((double)(u[i % 4] * 16.0f));
        }
        default: {
            return 0.0f;
        }
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:20,代码来源:RenderBlockSpike.java

示例2: draw

import net.minecraft.util.IIcon; //导入方法依赖的package包/类
@Override
public void draw(Renderer renderer, int x, int y)
{
	if(liquid != null)
	{
		TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

		Fluid fluid = liquid.getFluid();
		IIcon icon = fluid.getStillIcon();

		if(icon != null)
		{
			textureManager.bindTexture(TextureMap.locationBlocksTexture);

               double u = icon.getInterpolatedU(3.0);
               double u2 = icon.getInterpolatedU(13.0);
               double v = icon.getInterpolatedV(1.0);
               double v2 = icon.getInterpolatedV(15.0);

               GL11.glEnable(GL11.GL_TEXTURE_2D);
               GL11.glColor4d(1.0, 1.0, 1.0, 1.0);

       		GL11.glBegin(GL11.GL_QUADS);
       	        GL11.glTexCoord2d(u, v);
       	        GL11.glVertex2i(x + 3, y + 1);

       	        GL11.glTexCoord2d(u, v2);
       	        GL11.glVertex2i(x + 3, y + 15);

       	        GL11.glTexCoord2d(u2, v2);
       	        GL11.glVertex2i(x + 13, y + 15);

       	        GL11.glTexCoord2d(u2, v);
       	        GL11.glVertex2i(x + 13, y + 1);
       		GL11.glEnd();
		}
	}

	renderer.renderRect(x - 1, y - 1, 18, 18, containerTexture);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:41,代码来源:LiquidFilter.java

示例3: renderTorchAtAngle

import net.minecraft.util.IIcon; //导入方法依赖的package包/类
public static void renderTorchAtAngle(RenderBlocks renderBlocks, Block par1Block, double par2, double par4, double par6, double par8, double par10)
{
    // if (par1Block instanceof GCCoreBlockUnlitTorch)
    {
        final Tessellator tessellator = Tessellator.instance;
        IIcon icon = renderBlocks.getBlockIconFromSideAndMetadata(par1Block, 0, 0);

        final double d5 = icon.getMinU();
        final double d6 = icon.getMinV();
        final double d7 = icon.getMaxU();
        final double d8 = icon.getMaxV();
        final double d9 = icon.getInterpolatedU(7.0D);
        final double d10 = icon.getInterpolatedV(6.0D);
        final double d11 = icon.getInterpolatedU(9.0D);
        final double d12 = icon.getInterpolatedV(8.0D);
        final double d13 = icon.getInterpolatedU(7.0D);
        final double d14 = icon.getInterpolatedV(13.0D);
        final double d15 = icon.getInterpolatedU(9.0D);
        final double d16 = icon.getInterpolatedV(15.0D);
        par2 += 0.5D;
        par6 += 0.5D;
        final double d17 = par2 - 0.5D;
        final double d18 = par2 + 0.5D;
        final double d19 = par6 - 0.5D;
        final double d20 = par6 + 0.5D;
        final double d21 = 0.0625D;
        final double d22 = 0.625D;
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) - d21, par4 + d22, par6 + par10 * (1.0D - d22) - d21, d9, d10);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) - d21, par4 + d22, par6 + par10 * (1.0D - d22) + d21, d9, d12);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) + d21, par4 + d22, par6 + par10 * (1.0D - d22) + d21, d11, d12);
        tessellator.addVertexWithUV(par2 + par8 * (1.0D - d22) + d21, par4 + d22, par6 + par10 * (1.0D - d22) - d21, d11, d10);
        tessellator.addVertexWithUV(par2 + d21 + par8, par4, par6 - d21 + par10, d15, d14);
        tessellator.addVertexWithUV(par2 + d21 + par8, par4, par6 + d21 + par10, d15, d16);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4, par6 + d21 + par10, d13, d16);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4, par6 - d21 + par10, d13, d14);
        tessellator.addVertexWithUV(par2 - d21, par4 + 1.0D, d19, d5, d6);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4 + 0.0D, d19 + par10, d5, d8);
        tessellator.addVertexWithUV(par2 - d21 + par8, par4 + 0.0D, d20 + par10, d7, d8);
        tessellator.addVertexWithUV(par2 - d21, par4 + 1.0D, d20, d7, d6);
        tessellator.addVertexWithUV(par2 + d21, par4 + 1.0D, d20, d5, d6);
        tessellator.addVertexWithUV(par2 + par8 + d21, par4 + 0.0D, d20 + par10, d5, d8);
        tessellator.addVertexWithUV(par2 + par8 + d21, par4 + 0.0D, d19 + par10, d7, d8);
        tessellator.addVertexWithUV(par2 + d21, par4 + 1.0D, d19, d7, d6);
        tessellator.addVertexWithUV(d17, par4 + 1.0D, par6 + d21, d5, d6);
        tessellator.addVertexWithUV(d17 + par8, par4 + 0.0D, par6 + d21 + par10, d5, d8);
        tessellator.addVertexWithUV(d18 + par8, par4 + 0.0D, par6 + d21 + par10, d7, d8);
        tessellator.addVertexWithUV(d18, par4 + 1.0D, par6 + d21, d7, d6);
        tessellator.addVertexWithUV(d18, par4 + 1.0D, par6 - d21, d5, d6);
        tessellator.addVertexWithUV(d18 + par8, par4 + 0.0D, par6 - d21 + par10, d5, d8);
        tessellator.addVertexWithUV(d17 + par8, par4 + 0.0D, par6 - d21 + par10, d7, d8);
        tessellator.addVertexWithUV(d17, par4 + 1.0D, par6 - d21, d7, d6);
    }

}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:55,代码来源:BlockRendererUnlitTorch.java

示例4: apply

import net.minecraft.util.IIcon; //导入方法依赖的package包/类
@Override
public void apply(UV uv) {
    IIcon icon = icons[uv.tex % icons.length];
    uv.u = icon.getInterpolatedU(uv.u * 16);
    uv.v = icon.getInterpolatedV(uv.v * 16);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:7,代码来源:MultiIconTransformation.java

示例5: draw

import net.minecraft.util.IIcon; //导入方法依赖的package包/类
@Override
public void draw(Renderer renderer, int recipeX, int recipeY, Object[] data, int dataIndex, boolean isMouseOver)
{
	int x = recipeX + this.x;
	int y = recipeY + this.y;

	if(data[dataIndex] instanceof FluidStack)
	{
		FluidStack liquid = (FluidStack)data[dataIndex];

		TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

		Fluid fluid = liquid.getFluid();
		IIcon icon = fluid.getStillIcon();

		if(icon != null)
		{
			textureManager.bindTexture(TextureMap.locationBlocksTexture);

               double u = icon.getInterpolatedU(3.0);
               double u2 = icon.getInterpolatedU(13.0);
               double v = icon.getInterpolatedV(1.0);
               double v2 = icon.getInterpolatedV(15.0);

               GL11.glEnable(GL11.GL_TEXTURE_2D);
               GL11.glColor4d(1.0, 1.0, 1.0, 1.0);

       		GL11.glBegin(GL11.GL_QUADS);
       	        GL11.glTexCoord2d(u, v);
       	        GL11.glVertex2i(x + 3, y + 1);

       	        GL11.glTexCoord2d(u, v2);
       	        GL11.glVertex2i(x + 3, y + 15);

       	        GL11.glTexCoord2d(u2, v2);
       	        GL11.glVertex2i(x + 13, y + 15);

       	        GL11.glTexCoord2d(u2, v);
       	        GL11.glVertex2i(x + 13, y + 1);
       		GL11.glEnd();
		}
	}

	renderer.renderRect(x - 1, y - 1, 18, 18, containerTexture);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:46,代码来源:LiquidSlot.java


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