Jump to content

[1.7.2]Damaged block icons


Naiten

Recommended Posts

For some reason, my damaged block has same icons in inventory. Here's the code:

public class BlockPointer extends BlockContainer{
@SideOnly(Side.CLIENT)
private IIcon[] ico;

public BlockPointer(Material material){
	super(material);
	setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
	setBlockName("row.blockPointer");
	setCreativeTab(RoW.tabRoWEquip);
}

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list){
	list.add(new ItemStack(item, 1, 0));
	list.add(new ItemStack(item, 1, 1));
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p1, int p2){
	return this.ico[p2 % 2];
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_){
	this.ico = new IIcon[2];
	this.ico[0] = p_149651_1_.registerIcon("row:pointer");
	this.ico[1] = p_149651_1_.registerIcon("row:pointer_mod");
}

@Override
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4){
	Block block = par1World.getBlock(par2, par3, par4);
	return (block == null || block.isReplaceable(par1World, par2, par3, par4)) && par1World.isSideSolid(par2, par3 - 1, par4, ForgeDirection.UP);
}

@Override
public void breakBlock(World world, int i, int j, int k, Block p_149749_5_, int p_149749_6_){
	world.removeTileEntity(i, j, k);
}

@Override
public boolean renderAsNormalBlock(){
	return false;
}

@Override
public int getRenderType(){
	return -1;
}

@Override
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l){
	return false;
}

@Override
public boolean isOpaqueCube(){
	return false;
}

@Override
public TileEntity createNewTileEntity(World world, int par2){
	return new TileEntityPointer();
}
}

However, those items have different metadata and set it to blocks correctly.

If i helped you, don't forget pressing "Thank You" button. Thanks for your time.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.