blob: 894ccb62bededcfb9ab3525014934eb8f7985e4e [file] [log] [blame] [raw]
package li.cil.oc.util.mods
import cpw.mods.fml.common.Loader
object NEI {
private lazy val layoutManagerClass = try {
Class.forName("codechicken.nei.LayoutManager")
} catch {
case _: Throwable => null
}
def isInputFocused =
Loader.isModLoaded("NotEnoughItems") && layoutManagerClass != null && (try {
layoutManagerClass.getDeclaredMethods.find(m => m.getName == "getInputFocused").fold(false)(m => m.invoke(null) != null)
}
catch {
case _: Throwable => false
})
}