pantheis/ChargingBench — pull request #12 by Tallinu (2012-09-28 08:46:27+00:00)
Title: Everything works!

Turns out .charge and .discharge are automatically switching the ItemID of a stack if it ends up charged or empty. We don't have to switch it manually before charging it, and when a battery runs out the test to see if it was still the charged ID wasn't working, because it wasn't anymore. I had to put in an additional simulated .discharge of 1 EU to check if it was actually empty, and if so, create a new stack without the stupid "zero energy" tag compound that it leaves on everything it touches.

We're still having to create a copy of any ItemStack that could be stackable, or has separate item IDs for charged and empty, before doing the simulated .charge, to keep it from slapping "zero energy" tags on inappropriate items. But it should be much less of a performance penalty than copying every item in the charging area once per tick. The less object creation and destruction we're causing the better.

Until they fix that bug, we're stuck with the workaround for those items. However, with the workarounds in place...

Everything works!

Hooray!

We can has beta release now, unless you discover some showstopper.