Fixed botch-job implementation of Health Boost, will now actually work and not crash the server

This commit is contained in:
Dylan K. Taylor
2017-03-12 20:06:39 +00:00
parent f58ee2028e
commit 955dc38be4
3 changed files with 58 additions and 35 deletions

View File

@ -484,10 +484,6 @@ abstract class Entity extends Location implements Metadatable{
$this->effects[$effect->getId()] = $effect;
$this->recalculateEffectColor();
if($effect->getId() === Effect::HEALTH_BOOST){
$this->setHealth($this->getHealth() + 4 * ($effect->getAmplifier() + 1));
}
}
protected function recalculateEffectColor(){
@ -811,7 +807,7 @@ abstract class Entity extends Location implements Metadatable{
* @return int
*/
public function getMaxHealth(){
return $this->maxHealth + ($this->hasEffect(Effect::HEALTH_BOOST) ? 4 * ($this->getEffect(Effect::HEALTH_BOOST)->getAmplifier() + 1) : 0);
return $this->maxHealth;
}
/**