mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 19:56:17 -04:00
Updated for CoFH API changes in IToolHammer.
Also added support for unofficial CoFH API... because apparently some people are *still* shipping that crap. Fixes #1889. Silver lining: made me aware of isUsable/toolUsed on Entity targets :P
This commit is contained in:
parent
eb73a86a53
commit
c92e30442a
@ -56,6 +56,7 @@ class Wrench extends traits.SimpleItem with api.internal.Wrench {
|
||||
def canWrench(stack: ItemStack, player: EntityPlayer, pos: BlockPos): Boolean = true
|
||||
|
||||
// BluePower
|
||||
|
||||
def damage(stack: ItemStack, damage: Int, player: EntityPlayer, simulated: Boolean): Boolean = damage == 0
|
||||
|
||||
// BuildCraft
|
||||
@ -72,8 +73,18 @@ class Wrench extends traits.SimpleItem with api.internal.Wrench {
|
||||
|
||||
def isUsable(stack: ItemStack, player: EntityLivingBase, pos: BlockPos): Boolean = true
|
||||
|
||||
def isUsable(stack: ItemStack, player: EntityLivingBase, entity: Entity): Boolean = true
|
||||
|
||||
def toolUsed(stack: ItemStack, player: EntityLivingBase, pos: BlockPos): Unit = player.swingArm(EnumHand.MAIN_HAND)
|
||||
|
||||
def toolUsed(stack: ItemStack, player: EntityLivingBase, entity: Entity): Unit = player.swingArm(EnumHand.MAIN_HAND)
|
||||
|
||||
// Compat for people shipping unofficial CoFH APIs... -.-
|
||||
|
||||
def isUsable(stack: ItemStack, player: EntityLivingBase, x: Int, y: Int, z: Int): Boolean = true
|
||||
|
||||
def toolUsed(stack: ItemStack, player: EntityLivingBase, x: Int, y: Int, z: Int): Unit = player.swingArm(EnumHand.MAIN_HAND)
|
||||
|
||||
// EnderIO
|
||||
|
||||
def canUse(stack: ItemStack, player: EntityPlayer, pos: BlockPos): Boolean = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user