mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Update exhaustion values for 1.18.30 (#5034)
This commit is contained in:
@ -156,9 +156,9 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
|
||||
public function jump() : void{
|
||||
parent::jump();
|
||||
if($this->isSprinting()){
|
||||
$this->hungerManager->exhaust(0.8, PlayerExhaustEvent::CAUSE_SPRINT_JUMPING);
|
||||
$this->hungerManager->exhaust(0.2, PlayerExhaustEvent::CAUSE_SPRINT_JUMPING);
|
||||
}else{
|
||||
$this->hungerManager->exhaust(0.2, PlayerExhaustEvent::CAUSE_JUMPING);
|
||||
$this->hungerManager->exhaust(0.05, PlayerExhaustEvent::CAUSE_JUMPING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ class HungerManager{
|
||||
if($food >= 18){
|
||||
if($health < $this->entity->getMaxHealth()){
|
||||
$this->entity->heal(new EntityRegainHealthEvent($this->entity, 1, EntityRegainHealthEvent::CAUSE_SATURATION));
|
||||
$this->exhaust(3.0, PlayerExhaustEvent::CAUSE_HEALTH_REGEN);
|
||||
$this->exhaust(6.0, PlayerExhaustEvent::CAUSE_HEALTH_REGEN);
|
||||
}
|
||||
}elseif($food <= 0){
|
||||
if(($difficulty === World::DIFFICULTY_EASY && $health > 10) || ($difficulty === World::DIFFICULTY_NORMAL && $health > 1) || $difficulty === World::DIFFICULTY_HARD){
|
||||
|
@ -36,7 +36,7 @@ class HungerEffect extends Effect{
|
||||
|
||||
public function applyEffect(Living $entity, EffectInstance $instance, float $potency = 1.0, ?Entity $source = null) : void{
|
||||
if($entity instanceof Human){
|
||||
$entity->getHungerManager()->exhaust(0.025 * $instance->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||
$entity->getHungerManager()->exhaust(0.1 * $instance->getEffectLevel(), PlayerExhaustEvent::CAUSE_POTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user