mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Fixed botch-job implementation of Health Boost, will now actually work and not crash the server
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user