Fix IC2 energy bug and compatible with new build system