Forgive me for being annoyed that everyone seems to be ranting on something that I've put a fair bit of thought into (and worked on in collaboration with a fair number of invested developers). The intent has always been improving the entire eco-system of mods surrounding Buildcraft. =P
I really shouldn't let it get to me, but I'm not so good at filtering such stuff out. =(
Hey, your new PowerHandler is absolutely a huge step up in a lot of ways, which I've said repeatedly. But, it's also a huge move away from an API into a plug-and-play system. And that's alright, it's just a bit like moving from a rooted Android to an iPhone. Yeah, maybe the old ways were non-uniform, but the freedom afforded cannot be understated, even if the new one is really really shiny. People didn't screw up the old one out of incompetence, but merely because the old power API was incredibly obtuse. There were two legitimate ways to handle that - lock it down, or simplify it. Either is a completely valid decision, I just happen to prefer the latter.
I dont think anyones truly ranting about this, more questioning with passion...I for one know how hard you work and how helpful you are (youve personally helped me with railcraft issues in the past) and am truly grateful you exist as a minecraft entity (meta?) without you we'd be missing out on some cool shiz.
I think the question most people have is why is it in BC and not forge. Which you have just semi answered.
The reason it's in BC is because it is absolutely proprietary - it is the BC system, it's now a walled garden, where Forge is about freedom and flexibility. Again, it's actually a
very good plug-and-play system now, but if you want a universal power API, it needs to be way simpler and require devs to put in slightly more effort on their end. Basically it'd need to be what I wrote.
Now, as a test, I decided to write my machines such that BOTH work on them without issue.
Turns out, it's
trivial to wrap BC's system inside of mine, precisely because it is a freeform API:
Code:
/* IEnergyHandler */
@Override
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean doReceive) {
if (!doReceive) {
float limit = MathHelper.minF(getMaxEnergyStored(from) - getEnergyStored(from), powerHandler.getMaxEnergyReceived());
return (int) MathHelper.minF(limit, maxReceive);
}
return (int) powerHandler.getPowerReceiver().receiveEnergy(PowerHandler.Type.STORAGE, maxReceive, from);
}
@Override
public boolean canReceiveEnergy(ForgeDirection from) {
return true;
}
@Override
public boolean canSendEnergy(ForgeDirection from) {
return false;
}
@Override
public int getEnergyStored(ForgeDirection from) {
return (int) powerHandler.getEnergyStored();
}
@Override
public int getMaxEnergyStored(ForgeDirection from) {
return (int) powerHandler.getMaxEnergyStored();
}
/* IPowerReceptor */
@Override
public PowerReceiver getPowerReceiver(ForgeDirection side) {
return powerHandler.getPowerReceiver();
}
@Override
public void doWork(PowerHandler workProvider) {
}
@Override
public World getWorld() {
return worldObj;
}
Is it ideal? Absolutely not, but in this context I was only using it as unification. If you want universal energy, that's how it's done - provide a way to move energy from one tile to another, and leave the implementation up to the mods. Yeah they can screw it up, but that's no worse than items or fluids. Having said that, am I in favor of universal energy? Actually no, I'm not sure I see a benefit at this point. People complain that they can't make compact bases, but honestly that takes some of the joy out of Minecraft anyways.