blob: 7ed740437bf5c8a8cb28d2fbe046826b899b1bc3 [file] [log] [blame] [raw]
package li.cil.oc.util
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
}