I really love the look of luminators, but am a bit put off by having to run cable to them all (which requires me to spray CF foam everywhere to hide them), so as my first mod, I chose to create an item that would remotely charge luminators in range.
My issue is, after injecting 10 energy into a luminator, it should run out after 2.5 seconds (according to the wiki's consumption rate of 0.25 EU/t), but they don't. I've looked at TileEntityLuminator.java (JAD'ed from TileEntityLuminator.class) and it appears I should be able to just use injectEnergy but it's not working. If I use an Energy Crystal to charge the luminator, it runs out after a couple of game days, as intended.
Here's the code:
Code
TileEntity te = mc.theWorld.getBlockTileEntity((int)blockpos.xCoord, (int)blockpos.yCoord, (int)blockpos.zCoord);
if (te instanceof TileEntityLuminator)
{
TileEntityLuminator telumi = (TileEntityLuminator)te;
if (telumi.energy == 0)
{
int leftover = telumi.injectEnergy(Direction.XN, 10);
telumi.updateEntity();
plr.sendChatToPlayer("Injected " + (10 - leftover) + " energy");
}
// remove energy from lumi
}
Display More