diff --git a/src/main/scala/li/cil/oc/common/item/Chamelium.scala b/src/main/scala/li/cil/oc/common/item/Chamelium.scala index 281d258e7..cee8e32e2 100644 --- a/src/main/scala/li/cil/oc/common/item/Chamelium.scala +++ b/src/main/scala/li/cil/oc/common/item/Chamelium.scala @@ -16,11 +16,11 @@ class Chamelium(val parent: Delegator) extends Delegate { stack } - override def getItemUseAction(stack: ItemStack): EnumAction = EnumAction.eat + override def getItemUseAction(stack: ItemStack): EnumAction = EnumAction.EAT override def getMaxItemUseDuration(stack: ItemStack): Int = 32 - override def onEaten(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = { + override def onItemUseFinish(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = { if (!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.invisibility.id, 100, 0)) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200, 0)) diff --git a/src/main/scala/li/cil/oc/common/item/Delegate.scala b/src/main/scala/li/cil/oc/common/item/Delegate.scala index 8aaa03c5a..7ccc7e435 100644 --- a/src/main/scala/li/cil/oc/common/item/Delegate.scala +++ b/src/main/scala/li/cil/oc/common/item/Delegate.scala @@ -53,11 +53,11 @@ trait Delegate { stack } - def getItemUseAction(stack: ItemStack): EnumAction = EnumAction.none + def getItemUseAction(stack: ItemStack): EnumAction = EnumAction.NONE def getMaxItemUseDuration(stack: ItemStack) = 0 - def onEaten(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = stack + def onItemUseFinish(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = stack def onPlayerStoppedUsing(stack: ItemStack, player: EntityPlayer, duration: Int) {} diff --git a/src/main/scala/li/cil/oc/common/item/Delegator.scala b/src/main/scala/li/cil/oc/common/item/Delegator.scala index 1867c1fa8..6d9677ad4 100644 --- a/src/main/scala/li/cil/oc/common/item/Delegator.scala +++ b/src/main/scala/li/cil/oc/common/item/Delegator.scala @@ -126,14 +126,14 @@ class Delegator extends Item { // ----------------------------------------------------------------------- // - override def onEaten(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = - subItem(stack) match { - case Some(subItem) => subItem.onEaten(stack, world, player) - case _ => super.onEaten(stack, world, player) + override def onItemUseFinish(stack: ItemStack, world: World, player: EntityPlayer): ItemStack = + Delegator.subItem(stack) match { + case Some(subItem) => subItem.onItemUseFinish(stack, world, player) + case _ => super.onItemUseFinish(stack, world, player) } override def getItemUseAction(stack: ItemStack): EnumAction = - subItem(stack) match { + Delegator.subItem(stack) match { case Some(subItem) => subItem.getItemUseAction(stack) case _ => super.getItemUseAction(stack) }