blob: e8e02237bb9b9bb43f2fc9345ef3db5f2a1a7ed5 [file] [log] [blame] [raw]
package li.cil.oc.util.mods
import cpw.mods.fml.common.Loader
import net.minecraft.item.ItemStack
object IndustrialCraft2 {
private lazy val miningLaser = try {
val clazz = Class.forName("ic2.core.Ic2Items")
val field = clazz.getField("miningLaser")
Option(field.get(null).asInstanceOf[ItemStack])
}
catch {
case _: Throwable => None
}
def isMiningLaser(stack: ItemStack) = stack != null && Loader.isModLoaded("IC2") && (miningLaser match {
case Some(laser) => laser.itemID == stack.itemID
case _ => false
})
}