using ICustomElectricItem

  • Using ICustomElectricItem to create an "infinite" power source...
    i figured that by using:



    public int discharge(ItemStack itemStack, int amount, int tier, boolean ignoreTransferLimit, boolean simulate)
    {
    return 0;
    }


    the simulate would make it infinite but the problem is when i use the "public int charge" i have to put "boolean simulate" with the charge as well as discharge else i get an abstract error. so now my battery wont charge to begin with... is there a better way to do this?

    • Official Post

    The documentation on discharge says: @return Energy retrieved from the electric item


    You are returning 0 = it's impossible to get any energy from your item, which is quite the opposite of an infinite energy source. You should return amount instead.

  • haha sorry i thought i deleted this thread? I realised what i had done immediately after posting... my power source works perfectly now. thank you though XD hopefully have the addon up on the addon page after a little refinement with textures etc.