mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +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;
|
return true;
|
||||||
case Effect::HUNGER:
|
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;
|
return true;
|
||||||
case Effect::INSTANT_DAMAGE:
|
case Effect::INSTANT_DAMAGE:
|
||||||
case Effect::INSTANT_HEALTH:
|
case Effect::INSTANT_HEALTH:
|
||||||
@ -360,7 +354,7 @@ class Effect{
|
|||||||
|
|
||||||
case Effect::HUNGER:
|
case Effect::HUNGER:
|
||||||
if($entity instanceof Human){
|
if($entity instanceof Human){
|
||||||
$entity->exhaust(0.5 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
$entity->exhaust(0.025 * $this->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Effect::INSTANT_HEALTH:
|
case Effect::INSTANT_HEALTH:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user