blob: e3bcdb5740f508d126a15352f75ebef56ca2705d [file] [log] [blame] [raw]
package li.cil.oc.util.mods
import cpw.mods.fml.common.Loader
import net.minecraft.item.ItemStack
object PortalGun {
private lazy val portalGunClass = try {
Class.forName("portalgun.common.item.ItemPortalGun")
} catch {
case _: Throwable => null
}
def isPortalGun(stack: ItemStack) =
stack != null && stack.stackSize > 0 &&
Loader.isModLoaded("PortalGun") &&
portalGunClass != null &&
portalGunClass.isAssignableFrom(stack.getItem.getClass)
def isStandardPortalGun(stack: ItemStack) = isPortalGun(stack) && stack.getItemDamage == 0
}