AlternativeMods / AlternativeEnergy

Universal Power Storage for Minecraft
7 stars 3 forks source link

RF (Thermal Expansion) Power Support #5

Closed Flow86 closed 10 years ago

Flow86 commented 10 years ago

Hi,

can you implement RF support too?

API: https://gist.github.com/Flow86/7618849

usage example: (from logistic pipes)

    @Override
    @Optional.Method(modid = "CoFHCore")
    public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
        float space = freeSpace() / RFMultiplier;
        float minrequest = 1.01f / RFMultiplier;    //we round down, so always ask for a bit over 1LP-equivalent
        if(space < minrequest)
            space = minrequest;
        int availablelp = (int) Math.min(maxReceive, space) * RFMultiplier;
        if(availablelp > 0) {
            int totake = (int) availablelp / RFMultiplier;
            if(!simulate) {
                addEnergy(availablelp);
            }
            return totake;
        }
        return 0;
    }

    @Override
    @Optional.Method(modid = "CoFHCore")
    public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
        return 0;
    }

    @Override
    @Optional.Method(modid = "CoFHCore")
    public boolean canInterface(ForgeDirection from) {
        return true;
    }

    @Override
    @Optional.Method(modid = "CoFHCore")
    public int getEnergyStored(ForgeDirection from) {
        return 0;
    }

    @Override
    @Optional.Method(modid = "CoFHCore")
    public int getMaxEnergyStored(ForgeDirection from) {
        return MAX_STORAGE * RFMultiplier;
    }

I would create a PR, but you said you'll rewrite a lot?

jeffreykog commented 10 years ago

Thanks for the code. We were actually planning on doing so, but we were busy with rewriting things and making it more efficient. I will pull this in right now, and test it. Expect this to be in the next release (somewhere next week)

Flow86 commented 10 years ago

okay perfect, is there a build-service (jenkins or similar) where you have always "the latest" code or do you only release specific "builds"?

jeffreykog commented 10 years ago

Well, my jenkins is really slow, and not always online, and does not have that good of an internet uplink. So for now, we just push out releases when stuff is done. I am looking at an better and faster solution for my jenkins, and i'll love to just release every build

Flow86 commented 10 years ago

Ok, then I'll simply wait for your release ;-)

jeffreykog commented 10 years ago

Finally we fixed our jenkins. See http://ci.reening.nl/ for experimental builds