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


Java IIcon类代码示例

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


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

示例1: renderIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
private void renderIcon(IIcon icon) {
	Tessellator tessellator = Tessellator.instance;

	float minU = icon.getMinU();
	float maxU = icon.getMaxU();
	float minV = icon.getMinV();
	float maxV = icon.getMaxV();

	OpenGLHelper.rotate(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
	OpenGLHelper.rotate(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	tessellator.addVertexWithUV(-0.5F, -0.25F, 0.0D, minU, maxV);
	tessellator.addVertexWithUV(0.5F, -0.25F, 0.0D, maxU, maxV);
	tessellator.addVertexWithUV(0.5F, 0.75F, 0.0D, maxU, minV);
	tessellator.addVertexWithUV(-0.5F, 0.75F, 0.0D, minU, minV);
	tessellator.draw();
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:19,代码来源:LingeringPotionRenderer.java

示例2: isValidItemState

import net.minecraft.util.IIcon; //导入依赖的package包/类
/**
 * Resolve item state validity
 * @param meta Item metadata
 * @return Is item state valid
 */
@SuppressWarnings({"ConstantConditions"})
public boolean isValidItemState(int meta) {
    if (!isValid()) {
        return false;
    }
    try {
        IIcon sprite = item.getIconFromDamage(meta);
        return sprite != null &&
                sprite.getIconName() != null &&
                !sprite.getIconName().equalsIgnoreCase("") &&
                !sprite.getIconName().equalsIgnoreCase("missingno");
    } catch (Throwable ignored) {
        return false;
    }
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:21,代码来源:UItem.java

示例3: getTextures

import net.minecraft.util.IIcon; //导入依赖的package包/类
private static String getTextures(Block block, int damage) {
    List<String> allTextures = new ArrayList<String>();
    String[] sides = new String[]{"top", "bottom", "north", "south", "east", "west"};
    for (int index = 0; index < sides.length; index++) {
        try {
            IIcon icon = block.getIcon(index, damage);
            if (icon != null) {
                allTextures.add(icon.getIconName());
            }
        } catch (Exception e) {
            System.out.println(String.format("Unable to get texture for block %s side %s",
                    block.getLocalizedName(), index));
            allTextures.add("EXCEPTION");
        }
    }
    if (allTextures.isEmpty()) {
        return "empty";
    }
    return String.join(",", allTextures);
}
 
开发者ID:cameronleger,项目名称:DataDumper,代码行数:21,代码来源:Data.java

示例4: getIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
	if (meta == 0 && side == 3) 
	{
		return front;
	}
	
	if (side == 1) 
	{
		return top;
	}
	
	return side != meta ? this.blockIcon : front;
}
 
开发者ID:solidDoWant,项目名称:ExtraE,代码行数:17,代码来源:Collector.java

示例5: postStitch

import net.minecraft.util.IIcon; //导入依赖的package包/类
@SubscribeEvent
public void postStitch(TextureStitchEvent.Post event)
{
    IIcon[] icons;
    if(replaceLava)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.lava);
        icons[0] = newTextures[2];
        icons[1] = newTextures[3];
    }
    if(replaceWater)
    {
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.flowing_water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
        icons = ReflectionManager.get(field_tex, IIcon[].class, Blocks.water);
        icons[0] = newTextures[0];
        icons[1] = newTextures[1];
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:24,代码来源:LiquidTextures.java

示例6: getIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int i, int par2) {

	if (i == 0)
		return gor;

	else if (i == 1)
		return dol;

	else if (i == 2)
		return st1;

	else if (i == 3)
		return st2;

	else if (i == 4)
		return st4;

	else if (i == 5)
		return st3;

	else
		return gor;

}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:27,代码来源:BlockJenCraftingTable.java

示例7: addBlockHitEffects

import net.minecraft.util.IIcon; //导入依赖的package包/类
public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, IIcon icon, EffectRenderer effectRenderer)
{
    float border = 0.1F;
    Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2*border);
    diff.x*=world.rand.nextDouble();
    diff.y*=world.rand.nextDouble();
    diff.z*=world.rand.nextDouble();
    Vector3 pos = diff.add(bounds.min).add(border);
    
    if (side == 0)
        diff.y = bounds.min.y - border;
    if (side == 1)
        diff.y = bounds.max.y + border;
    if (side == 2)
        diff.z = bounds.min.z - border;
    if (side == 3)
        diff.z = bounds.max.z + border;
    if (side == 4)
        diff.x = bounds.min.x - border;
    if (side == 5)
        diff.x = bounds.max.x + border;
    
    effectRenderer.addEffect(
            new EntityDigIconFX(world, pos.x, pos.y, pos.z, 0, 0, 0, icon)
                .multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:27,代码来源:EntityDigIconFX.java

示例8: handleStich

import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void handleStich(final TextureStitchEvent.Pre event) {
    if (event.map.getTextureType() != 0) {
        return;
    }
    TConIntegration.bedrock.setIcons(event.map.registerIcon("TConIntegration.bedrock"));
    TextureAtlasSprite sprite = new TextureBedrockLava("extrautils:bedrockFluid", "lava_still");
    event.map.setTextureEntry("extrautils:bedrockFluid", sprite);
    if (TConIntegration.bedrock != null) {
        TConIntegration.bedrock.setIcons((IIcon)sprite);
    }
    sprite = new TextureBedrockLava("extrautils:bedrockFluid_flowing", "lava_flow");
    if (event.map.setTextureEntry("extrautils:bedrockFluid_flowing", sprite) && TConIntegration.bedrock != null) {
        TConIntegration.bedrock.setFlowingIcon((IIcon)sprite);
    }
    sprite = new TextureUnstableLava("extrautils:unstableFluid", "water_still");
    event.map.setTextureEntry("extrautils:unstableFluid", sprite);
    if (TConIntegration.unstable != null) {
        TConIntegration.unstable.setIcons((IIcon)sprite);
    }
    sprite = new TextureUnstableLava("extrautils:unstableFluid_flowing", "water_flow");
    if (event.map.setTextureEntry("extrautils:unstableFluid_flowing", sprite) && TConIntegration.unstable != null) {
        TConIntegration.unstable.setFlowingIcon((IIcon)sprite);
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:27,代码来源:TConEvents.java

示例9: getIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2)
{
    if (par2 >= BlockAirLockFrame.METADATA_AIR_LOCK_CONTROLLER)
    {
        if (par1 == ForgeDirection.UP.ordinal() || par1 == ForgeDirection.DOWN.ordinal())
        {
            return this.airLockIcons[0];
        }

        return this.airLockIcons[7];
    }
    else
    {
        return this.airLockIcons[0];
    }
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:19,代码来源:BlockAirLockFrame.java

示例10: getIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
public IIcon getIcon(int side, int meta) {
	switch (meta) {
	case 1:
		return OnePlayerIcon;
	case 2:
		return TwoPlayersIcon;
	case 3:
		return ThreePlayersIcon;
	case 4:
		return FourPlayersIcon;
	default:
		return LobbyIcon;
	}
}
 
开发者ID:TominoCZ,项目名称:PAYDAY,代码行数:16,代码来源:LobbyBlock.java

示例11: renderInventoryBlock

import net.minecraft.util.IIcon; //导入依赖的package包/类
public static void renderInventoryBlock(RenderBlocks renderblocks, Block block, IIcon icon) {
	
	Tessellator tessellator = Tessellator.instance;
	GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1F, 0.0F);
	renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, -1F);
	renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(-1F, 0.0F, 0.0F);
	renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	tessellator.startDrawingQuads();
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, getValidIIcon(icon));
	tessellator.draw();
	GL11.glTranslatef(0.5F, 0.5F, 0.5F);
	
}
 
开发者ID:grand-mine-inc,项目名称:Steam-and-Steel,代码行数:32,代码来源:Utils.java

示例12: setIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void setIcon(int index, IIcon icon) {
	if (icons == null)
		icons = new IIcon[types.length];

	icons[index] = icon;
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:8,代码来源:PrismarineBlocks.java

示例13: registerBlockIcons

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
	if (icons == null)
		icons = new IIcon[types.length];

	for (int i = 1; i < types.length; i++)
		if ("".equals(types[i]))
			icons[i] = reg.registerIcon(getTextureName());
		else
			icons[i] = reg.registerIcon(getTextureName() + "_" + types[i]);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:13,代码来源:PrismarineBlocks.java

示例14: registerBlockIcons

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
	icons = new IIcon[types.length];
	for (int i = 0; i < types.length; i++)
		if ("".equals(types[i]))
			icons[i] = reg.registerIcon(getTextureName());
		else
			icons[i] = reg.registerIcon(getTextureName() + "_" + types[i]);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:11,代码来源:BlockGeneric.java

示例15: getIcon

import net.minecraft.util.IIcon; //导入依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
	if (meta < 0 || meta >= icons.length)
		meta = 0;
	return icons[meta];
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:8,代码来源:FrostedIce.java


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