net.minecraft.util.IIcon Java Examples

The following examples show how to use net.minecraft.util.IIcon. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RenderBlocksCTM.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon)
{
    if(rendererOld != null && rendererOld.hasOverrideBlockTexture())
    {
        IIcon i = rendererOld.overrideBlockTexture;

        tessellator.addVertexWithUV(0.0, 0.0, 1.0, i.getMinU(), i.getMaxV());
        tessellator.addVertexWithUV(0.0, 0.0, 0.0, i.getMinU(), i.getMinV());
        tessellator.addVertexWithUV(1.0, 0.0, 0.0, i.getMaxU(), i.getMinV());
        tessellator.addVertexWithUV(1.0, 0.0, 1.0, i.getMaxU(), i.getMaxV());
    } else
    {
        int tex[] = CTM.getSubmapIndices(blockAccess, bx, by, bz, 0);

        setupSides(0, 3, 7, 4, 18, 21, 20, 19, 13);
        side(13, 21, 7, 20, tex[3], true);
        side(19, 13, 20, 4, tex[2], true);
        side(0, 18, 13, 19, tex[0], true);
        side(18, 3, 21, 13, tex[1], true);
    }
}
 
Example #2
Source File: RenderBlocksEldritch.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void renderFaceYNeg(Block block, double x, double y, double z, IIcon icon)
{
    setupSides(icon, 0, 3, 7, 4, 13, 0, 3, 7, 4);
    vert(0);
    vert(3);
    vert(13);
    vert(13);
    vert(3);
    vert(7);
    vert(13);
    vert(13);
    vert(7);
    vert(4);
    vert(13);
    vert(13);
    vert(4);
    vert(0);
    vert(13);
    vert(13);
}
 
Example #3
Source File: RenderBlocksCTM.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
void side(int a, int b, int c, int d, int iconIndex, boolean flip)
{
    IIcon icon = iconIndex >= 16 ? submapSmall.icons[iconIndex - 16] : submap.icons[iconIndex];

    double u0 = icon.getMaxU();
    double u1 = icon.getMinU();
    double v0 = icon.getMaxV();
    double v1 = icon.getMinV();

    U[a] = flip ? u1 : u1;
    U[b] = flip ? u0 : u1;
    U[c] = flip ? u0 : u0;
    U[d] = flip ? u1 : u0;

    V[a] = flip ? v1 : v1;
    V[b] = flip ? v1 : v0;
    V[c] = flip ? v0 : v0;
    V[d] = flip ? v0 : v1;

    vert(a);
    vert(b);
    vert(c);
    vert(d);
}
 
Example #4
Source File: ItemMachineUpgrade.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister){
    texture = new IIcon[UPGRADES_AMOUNT];
    texture[0] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_VOLUME);
    texture[1] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_DISPENSER);
    texture[2] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_ITEM_LIFE);
    texture[3] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_ENTITY_TRACKER);
    texture[4] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_BLOCK_TRACKER);
    texture[5] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SPEED);
    texture[6] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SEARCH);
    texture[7] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_COORDINATE_TRACKER);
    texture[8] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_RANGE);
    texture[9] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_SECURITY);
    texture[10] = par1IconRegister.registerIcon(Textures.ITEM_UPGRADE_THAUMCRAFT);
}
 
Example #5
Source File: BlockLatticeWood.java    From GardenCollection with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon (int side, int meta) {
    Block protoBlock = TileEntityLatticeWood.instance.getBlockFromComposedMetadata(meta);
    if (protoBlock != null)
        return protoBlock.getIcon(side, TileEntityLatticeWood.instance.getMetaFromComposedMetadata(meta));

    return Blocks.planks.getIcon(side, meta);
}
 
Example #6
Source File: ItemWrench.java    From Framez with GNU General Public License v3.0 5 votes vote down vote up
@Override
public IIcon getIconIndex(ItemStack stack) {

    if (stack.getItemDamage() == 0)
        return normal;
    if (stack.getItemDamage() == 1)
        return rotate;
    if (stack.getItemDamage() == 2)
        return debug;
    if (stack.getItemDamage() == 3)
        return config;

    return super.getIconIndex(stack);
}
 
Example #7
Source File: BW_TileEntityContainer_Multiple.java    From bartworks with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
    this.texture = new IIcon[this.textureNames.length];
    for (int i = 0; i < this.textureNames.length; i++) {
        this.texture[i] = par1IconRegister.registerIcon(this.textureNames[i]);
    }
}
 
Example #8
Source File: BlockRoseBush.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
/**
 * Gets the block's texture. Args: side, meta
 */
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
    if(meta == 1)
        return bottom;
    else
        return top;
}
 
Example #9
Source File: CarvableHelper.java    From Chisel-2 with GNU General Public License v2.0 5 votes vote down vote up
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
	int metadata = world.getBlockMetadata(x, y, z);

	if (metadata < 0 || metadata > 15)
		metadata = 0;

	IVariationInfo info = infoMap[metadata];
	if (info == null)
		return getMissingIcon();

	return info.getIcon(world, x, y, z, side);
}
 
Example #10
Source File: ItemQuantumGoggles.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
@Override
public void registerIcons( IIconRegister iconRegister )
{
    s_icons = new IIcon[ SubTypes.Count ];
    s_icons[ SubTypes.Quantum ] = iconRegister.registerIcon( "qcraft:goggles" );
    s_icons[ SubTypes.AntiObservation ] = iconRegister.registerIcon( "qcraft:ao_goggles" );
}
 
Example #11
Source File: BlockReactorPart.java    From BigReactors with MIT License 5 votes vote down vote up
private IIcon getCasingEdgeIcon(TileEntityReactorPart part, MultiblockReactor reactor, int side) {
	if(reactor == null || !reactor.isAssembled()) { return _icons[METADATA_CASING][DEFAULT]; }

	CoordTriplet minCoord = reactor.getMinimumCoord();
	CoordTriplet maxCoord = reactor.getMaximumCoord();

	boolean xExtreme, yExtreme, zExtreme;
	xExtreme = yExtreme = zExtreme = false;

	if(part.xCoord == minCoord.x || part.xCoord == maxCoord.x) { xExtreme = true; }
	if(part.yCoord == minCoord.y || part.yCoord == maxCoord.y) { yExtreme = true; }
	if(part.zCoord == minCoord.z || part.zCoord == maxCoord.z) { zExtreme = true; }
	
	int idx = DEFAULT;
	if(!xExtreme) {
		if(side < 4) { idx = EASTWEST; }
	}
	else if(!yExtreme) {
		if(side > 1) {
			idx = VERTICAL;
		}
	}
	else { // !zExtreme
		if(side < 2) {
			idx = NORTHSOUTH;
		}
		else if(side > 3) {
			idx = EASTWEST;
		}
	}
	return _icons[METADATA_CASING][idx];
}
 
Example #12
Source File: BlockCompostBin.java    From GardenCollection with MIT License 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons (IIconRegister register) {
    icons = new IIcon[4];

    icons[ICON_SIDE] = register.registerIcon(GardenCore.MOD_ID + ":compost_bin_side");
    icons[ICON_TOP] = register.registerIcon(GardenCore.MOD_ID + ":compost_bin_top");
    icons[ICON_BOTTOM] = register.registerIcon(GardenCore.MOD_ID + ":compost_bin_bottom");
    icons[ICON_INNER] = register.registerIcon(GardenCore.MOD_ID + ":compost_bin_inner");
}
 
Example #13
Source File: ItemDeadlyShard.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister ir) {
    icons = new IIcon[7];

    for (int x = 0; x < 7; x++) {
        icons[x] = ir.registerIcon("forbidden:" + vices[x] + "shard");
    }
}
 
Example #14
Source File: TextureSubmap.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public TextureSubmap(IIcon i, int w, int h)
{
    icon = i;
    width = w;
    height = h;
    icons = new IIcon[width * height];

    MinecraftForge.EVENT_BUS.register(this);
}
 
Example #15
Source File: FrostedIce.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
	if (meta < 0 || meta >= icons.length)
		meta = 0;
	return icons[meta];
}
 
Example #16
Source File: BlockQBlock.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
@Override
public IIcon getIcon( int side, int damage )
{
    if( s_forceGrass )
    {
        return Blocks.grass.getIcon( side, damage );
    }
    else
    {
        return s_swirlIcon;
    }
}
 
Example #17
Source File: FarmLogicHelium.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public IIcon getIcon(){
    if(icon == null) {
        ItemStack stack = new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.HELIUM_PLANT_DAMAGE);
        icon = stack.getIconIndex();
    }
    return icon;
}
 
Example #18
Source File: ItemMobCrystal.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister ir) {
    icons = new IIcon[2];

    icons[0] = ir.registerIcon("forbidden:emptycrystal");
    icons[1] = ir.registerIcon("forbidden:mobcrystal");
}
 
Example #19
Source File: BlockElevatorCaller.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
    TileEntityElevatorCaller te = (TileEntityElevatorCaller)world.getTileEntity(x, y, z);
    if(te.camoBlock != null && PneumaticCraftUtils.isRenderIDCamo(te.camoBlock.getRenderType())) {
        return te.camoBlock.getIcon(side, te.camoStack.getItemDamage());
    }
    return this.getIcon(side, world.getBlockMetadata(x, y, z));
}
 
Example #20
Source File: ModularBoxRenderer.java    From GardenCollection with MIT License 5 votes vote down vote up
private void renderInteriorFace (int face, IBlockAccess blockAccess, Block block, double x, double y, double z) {
    IIcon icon = interiorIcon[face];
    float r = interiorColor[face][0];
    float g = interiorColor[face][1];
    float b = interiorColor[face][2];

    renderFace(face, blockAccess, block, x, y, z, icon, r, g, b);
}
 
Example #21
Source File: BlockLogTainted.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side)
{
    int meta = world.getBlockMetadata(x, y, z);
    int logDirection = meta & 12;
    if((logDirection == 0 && (side == 1 || side == 0)) || (logDirection == 4 && (side == 5 || side == 4)) || (logDirection == 8 && (side == 2 || side == 3)))
        return ends;
    else {
        Random r = new Random((long)(side + y + x * z));
        return r.nextInt(100) < 75 ? sides : r.nextBoolean() ? gross : gross2;
    }
}
 
Example #22
Source File: GT_Block_CasingsNH.java    From NewHorizonsCoreMod with GNU General Public License v3.0 5 votes vote down vote up
private IIcon getTurbineCasing(int meta, int iconIndex, boolean active) {
    switch (meta) {
        case 0:
            return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon();
        default:
            return active ? Textures.BlockIcons.TURBINE_ACTIVE[iconIndex].getIcon() : Textures.BlockIcons.TURBINE[iconIndex].getIcon();
    }
}
 
Example #23
Source File: RenderCoverPlate.java    From Artifacts with MIT License 5 votes vote down vote up
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
	int l = world.getBlockMetadata(x, y, z);
	switch(l) {
        case 2:
        	z++;
        	break;
        case 3:
        	z--;
        	break;
        case 4:
        	x++;
        	break;
        case 5:
        	x--;
        	break;
    }
	Block blockToCopy = world.getBlock(x, y, z);
	if(blockToCopy == null) {
		blockToCopy = Blocks.planks;
	}
	int meta = world.getBlockMetadata(x, y, z);
	IIcon camo = blockToCopy.getIcon(l, meta);
    y--;
	renderer.renderBlockUsingTexture(blockToCopy, x, y, z, camo);
	renderer.renderBlockUsingTexture(Blocks.ice, x, y, z, block.getIcon(0, 0));
	//renderer.renderStandardBlock(Block.ice, x, y, z);
	return true;
}
 
Example #24
Source File: BlockLatticeWood.java    From GardenCollection with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon (IBlockAccess blockAccess, int x, int y, int z, int side) {
    TileEntityBlockMateralProxy te = getTileEntity(blockAccess, x, y, z);
    if (te == null || te.getProtoBlock() == null)
        return super.getIcon(blockAccess, x, y, z, side);

    Block protoBlock = te.getProtoBlock();
    if (protoBlock == null)
        protoBlock = Blocks.planks;

    return protoBlock.getIcon(side, te.getProtoMeta());
}
 
Example #25
Source File: Drawing.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
public static void drawBlock(Block block, IIcon icon, RenderBlocks renderer)
{
    Tessellator tessellator = Tessellator.instance;

    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon);
    tessellator.draw();
}
 
Example #26
Source File: BlockFlowerLeaves.java    From GardenCollection with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
public IIcon getFlowerIcon (IBlockAccess world, int x, int y, int z, int meta, int side) {
    boolean clear1 = world.getBlock(x, y + 1, z) != this;
    boolean clear2 = world.getBlock(x, y, z - 1) != this;
    boolean clear3 = world.getBlock(x, y, z + 1) != this;
    boolean clear4 = world.getBlock(x - 1, y, z) != this;
    boolean clear5 = world.getBlock(x + 1, y, z) != this;

    if (side == 1 && clear1)
        return flowersTop[meta & 3];
    else if ((side == 2 && clear2) || (side == 3 && clear3) || (side == 4 && clear4) || (side == 5 && clear5))
        return clear1 ? flowersTopSide[meta & 3] : flowersSide[meta & 3];

    return null;
}
 
Example #27
Source File: SlotPneumaticArmor.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
/**
 * Returns the icon index on items.png that is used as background image of the slot.
 */
public IIcon getBackgroundIconIndex(){
    return ItemArmor.func_94602_b(armorType);
}
 
Example #28
Source File: BlockBRDevice.java    From BigReactors with MIT License 5 votes vote down vote up
private IIcon safeGetIcon(IIcon[] list, int idx, int x, int y, int z) {
	if(idx < 0 || idx >= list.length) {
		BRLog.warning("Invalid metadata (%d) for block at %d, %d, %d!", idx, x, y, z);
		return blockIcon;
	}
	else {
		return list[idx];
	}
}
 
Example #29
Source File: BlockBanner.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
	return Blocks.planks.getBlockTextureFromSide(side);
}
 
Example #30
Source File: ItemFakeModIcon.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public IIcon getIconFromDamage(int damage) {
    if(damage < 0 || damage >= icons.length) return null;
    return icons[damage];
}