blob: 1b0894e65836a727a882f317b41ffc55e3432b25 [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
})
}