Tech Reborn

Tech Reborn

30M Downloads

Transformers should output multiple packets

coderbot16 opened this issue ยท 5 comments

commented

In IC2, transformers output multiple packets per tick. For example, an LV transformer taking in 128EU/t packets is capable of outputting 128EU/t, however split up into 4 32EU/t packets.

While this is not significant under the FE power system, as the FE power system is not packet based, it is important under the EU power system as effectively TR transformers output 1/4th the power compared to their IC2 variants.

After some inspection of IC2's API, it appears like the way to make this work is to implement IMultiEnergySource (interface definition here) on transformer power suppliers. It doesn't appear that there are any performance issues with unconditionally implementing IMultiEnergySource, since they are treated the same as all other energy sources if they return false from sendMultipleEnergyPackets.

However, since the IC2 helper API only receives a TilePowerAcceptor, while it would be possible to instanceof TileTransformer it would probably be better to add a maxEmittedPackets field to TilePowerAcceptor in RebornCore.

If you want I can create some pull requests to fix these issues (with a multipacket config option, of course).

commented

Yes, this seems a reasonable change.

That class does have a comment saying it is going to be removed in future versions, does this mean there is a replacement now? Or something that will need to be crossed when it happens.

If you are happy to create a PR that would be great as you know a lot more about IC2 power net.

commented

It says that it will be removed in the future, however seeing as there is no replacement and how a critical aspect of gameplay relies on it (Transformers) I don't think that will happen. Also, the link is the IC2 Classic API, which might contain outdated comments since it is based on an older IC2E api. I did verify and IC2 Experimental still contains the API, so it's unlikely to be removed since there isn't an alternative. The comment is probably from the pre-1.9 era when the enet ignored tiers, so transformers didn't matter.

I'm actually working on another PR to unify the IC2E and IC2C compat layers, but all I have to to is rebase it on your latest commits to TR-MC and it will be ready, then I can add the support to TR-MC.

commented

Sounds good, if it does get removed it wont be too much of a pain to remove/swtich to the replacement.

commented

Of course, and I highly doubt that they'll break the API this late into 1.12. Things should be pretty stable on that front.

commented

Fixed