Update Cake.php

This commit is contained in:
Creeperface01 2015-12-04 16:00:02 +01:00
parent 2ddc4455c5
commit 7954754d4c

View File

@ -96,16 +96,18 @@ class Cake extends Transparent{
$ev = new EntityRegainHealthEvent($player, 3, EntityRegainHealthEvent::CAUSE_EATING); $ev = new EntityRegainHealthEvent($player, 3, EntityRegainHealthEvent::CAUSE_EATING);
$player->heal($ev->getAmount(), $ev); $player->heal($ev->getAmount(), $ev);
if($this->meta >= 0x06){ if(!$ev->isCancelled()){
$this->getLevel()->setBlock($this, new Air(), true); if($this->meta >= 0x06){
}else{ $this->getLevel()->setBlock($this, new Air(), true);
$this->getLevel()->setBlock($this, $this, true); }else{
$this->getLevel()->setBlock($this, $this, true);
}
return true;
} }
return true;
} }
return false; return false;
} }
} }