mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Effect: Hunger is supposed to apply every tick
This fixes oddities in the behaviour noticeable with higher effect levels.
This commit is contained in:
parent
36f3accf4b
commit
9d4818d360
@ -314,12 +314,6 @@ class Effect{
|
||||
}
|
||||
return true;
|
||||
case Effect::HUNGER:
|
||||
if($this->amplifier < 0){ // prevents hacking with amplifier -1
|
||||
return false;
|
||||
}
|
||||
if(($interval = 20) > 0){
|
||||
return ($this->duration % $interval) === 0;
|
||||
}
|
||||
return true;
|
||||
case Effect::INSTANT_DAMAGE:
|
||||
case Effect::INSTANT_HEALTH:
|
||||
@ -360,7 +354,7 @@ class Effect{
|
||||
|
||||
case Effect::HUNGER:
|
||||
if($entity instanceof Human){
|
||||
$entity->exhaust(0.5 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||
$entity->exhaust(0.025 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||
}
|
||||
break;
|
||||
case Effect::INSTANT_HEALTH:
|
||||
|
Loading…
x
Reference in New Issue
Block a user