mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Adjustments for 1.8.
This commit is contained in:
parent
9e2371c7d7
commit
e8a73e8e9c
@ -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))
|
||||
|
@ -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) {}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user