Mekanism

Mekanism

111M Downloads

AE2 - IC2 Power Tunnel

AlgorithmX2 opened this issue ยท 7 comments

commented

Not sure if this is a Mek issue or IC2, seems like Universal cables can't accept EU, and never inject EU based on the IC2 demand.

Originating Issue: http://ae2.ae-mod.info/Tracker/0728/

commented

I'm referring to https://gist.github.com/unpairedbracket/0be492c0bad26b88b5aa and IEnergyHandler as in CoFH's IEnergyHandler; our power distribution method was trying to emit to different power systems in turn, and not trying others if it was encountering an RF acceptor (or at least, an IEnergyHandler tile), even if it didn't actually accept RF from that side. That was our bug and I've now fixed it.

Calling EnergyNet.instance.getPowerFromTier(Integer.MAX_VALUE)returns 0, I'm not sure why exactly. The function seems to be 8_4^tier, so the max safe input in that case would be 8_4^(2^31-1), which is around 2^(4.3billion), far larger than the maximum double value. I'm assuming in this overflows to 0.

commented

The reason it works for IC2 is that IC2 doesn't try and avoid pushing more than the maximum safe input to something to prevent it from exploding, I would assume.

commented

Upon further investigation, Universal Cables can pull from EU power tunnels just fine, but not inject (in my dev environment at least). I'll try and find out why.

commented

Ah - it's because the p2p tunnels appear to be implementing IEnergyHandler but not accepting from any side because they're EU tunnels (presumably, I'll leave it to you to confirm whether this is the case). Our code that looks for acceptors tries to add it as an RF acceptor first, fails, and doesn't try IC2. I'll see if I can fix it.

commented

Also, the EU tunnel claims its tier is 2^31 - 1 (presumably the maximum int value?), which IC2 says has a maximum safe power level of 0. I think if this changes (and I make the change mentioned above) it should start working.

commented

It works fine with IC2, so it should be accepting power just fine. The first thing I did was ensured that it was working fine with IC2 before checking mekanism.

I'm not sure what IEnergyHandler is, I don't see that in the IC2 api.

according to the IC2 API,
https://gist.github.com/AlgorithmX2/0ddd6ceaa9283ea3e322

So I'm not sure why your saying IC2 says it has a max safe power level of 0.

commented

I see you have made some changes, and someone one has indicated that it is now working on my track, so I'm going to close the issue.