[API question] demandsEnergy changes

  • In 1.4.6, IEnergySink.demandsEnergy now returns an int instead of a boolean.
    The javadoc only says "Determine how much energy the sink accepts. This value is unrelated to getMaxSafeInput(). Returns: max accepted input in eu"
    How does IC2 use this number?

    Disappointed with the bugs and nerfedness of AtomicStryker Corp's Advanced Machines, and the unupdatedness of Snyke's Enterprises?
    Need low-lag renewable power?
    Come to ImmTech Intragalactical this thread for free UUM!

    Note: UUM may stand for Unnerfed Unbuggy Updated Machines and may not be actual UUM. The extra U was lost due to a bit error.
    Battery snot included.

  • EnergyNet.java says it's being used much like the previous version:

    Code
    if(entry.demandsEnergy() > 0 && i$.loss < (double)amount) {


    Personally, I'm using it, and its friend injectEnergy, like so (from BeamMeUp source:(


    It does mean I tend to end up with slightly more than ENERGY_CAPACITY EUs stored in the machine, but that really doesn't get in the way much, if at all.

  • I'm using something like this:



    Note that my conversion algorithm uses maxEnergy in such a way that I don't ever have more energy than maxEnergy (so the input is consistent).