IC2 API Error with AtomicStryker's Power Converters

  • Hello IC2 devs! I've been having an error on my server and the mod owner advised me to give you guys a shout. Basically, I have a "hydro-flower" set up using an IC2 MFE, a BC3 Pump, an Energy Link, and Water Strainers. Whenever the MFE gets full, I get this error:


    Code
    1. [WARNING] [IC2] API ERROR: atomicstryker.powerconverters.common.TileEntityEnergyLink@2b99e8cd didn't implement demandsEnergy() properly, no
    2. energy from injectEnergy accepted although demandsEnergy() returned true.



    I talked to AtomicStryker and he advised:




    "Looks good to me. You probably have some sort of fringe case where the water strainers continue to try and inject energy AFTER its full"


    "You could ask in the IC2 forum or IRC chat, one of the devs, what could be causing this issue and link them to the source.
    http://code.google.c...dGenerator.java"



    So, here I am, figured I give it a shot! Thanks!


    EDIT: Forgot to list Version Numbers...


    Minecraft Version 1.4.5
    MCForge Version 6.4.0.396
    BC3 Version 3.2.0
    IC2 Version 1.109.113
    Power Converters Version 1.4.4

    The post was edited 1 time, last by Zarkazm: Forgot to list Version Numbers... ().

  • Not a API Bug


    if demandsEnergy() true injectEnergy must always return 0


    why you need power demandsEnergy and not use it ?? ;) ...


    is to time so if i make MFFS i found It also curiously but ..aaccording to IC2 devs i.o.

  • Thats not right. "demandsEnergy" is only called once per tick (Data aquired through massive testing), so if multiple packets get fired in one Tick, into a full Machine with that Code (I had that Code too), then you will receive that Errorlog.

  • Checked out Gregs code but yes, the API does not work properly.


    The way it is supposed to work (i hope) is injectEnergy returns not 0 but the value of power the injection did not manage to stuff into the machine. Thus, you do not lose EU when injecting 100 into a machine that only has space for 50.


    Now what Greg does to avoid the error message is simply waste those +50 EU by always returning 0. As mentioned on MCF, i could avoid the error by wasting a little EU instead. I guess i'll have to do that, then.

  • Now what Greg does to avoid the error message is simply waste those +50 EU by always returning 0. As mentioned on MCF, i could avoid the error by wasting a little EU instead. I guess i'll have to do that, then.

    I do not waste that Energy. It will just get accepted, making it possible to store all the overflow, which gets injected in that tick, no matter how large the overflow is.


    Try to put 100 32EU-Packets into one Machine and use my Debug-Scanner on said Machine to get its REAL Energylevel, as getCapacity() returns only the max Level, when using things like Nuclear Control, to prevent confused people posting stupid Stuff and such.