[1.7.2][modding] IC2.1.4769 experimental build: set ItemTexture based on charge

  • Hi there,
    the question is in the title.
    My idea is to read out the charge with the ItemManager and than change the icon, but how and where?


    Thank's for each anwser!
    DrBlock42


    PS: I know this is more an general forge question, but... I thought this would fit more in this forum.

    • Official Post

    If it's your own item:


    - override requiresMultipleRenderPasses to return true (just to unlock the next hook,not actual multipass rendering)
    - override getIcon(ItemStack itemStack, int pass) and return the item you want after determining it from the supplied itemstack argument (ElectricItem.manager.getCharge(itemStack) or similar)


    If it's not your own item you afaik can't do this without major hackery.


    Addon discussion is usually the best forum to ask this type of question.