Improved format constants, fixed cake eating when max health is > 20

This commit is contained in:
Shoghi Cervantes
2015-04-20 17:25:58 +02:00
parent f88aed1208
commit 15b4cd8fb3
3 changed files with 27 additions and 25 deletions

View File

@ -90,7 +90,7 @@ class Cake extends Transparent{
}
public function onActivate(Item $item, Player $player = null){
if($player instanceof Player and $player->getHealth() < 20){
if($player instanceof Player and $player->getHealth() < $player->getMaxHealth()){
++$this->meta;
$ev = new EntityRegainHealthEvent($player, 3, EntityRegainHealthEvent::CAUSE_EATING);