blob: 34c110c8163838fe654368d24fac3ab10a34d278 [file] [log] [blame] [raw]
package li.cil.oc.integration.projectred
import mrtjp.projectred.api.IScrewdriver
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack
object EventHandlerProjectRed {
def useWrench(player: EntityPlayer, x: Int, y: Int, z: Int, changeDurability: Boolean): Boolean = {
player.getHeldItem.getItem match {
case wrench: IScrewdriver =>
if (changeDurability) {
wrench.damageScrewdriver(player.getEntityWorld, player)
true
}
else true
case _ => false
}
}
def isWrench(stack: ItemStack): Boolean = stack.getItem.isInstanceOf[IScrewdriver]
}