mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fixed the half-done hunger implementation, fixed lots of bugs related to hunger
- Fixed starvation doesn't deal any damage at all (Human->getFood() returns a float, not an int, === 0 won't work so great) - Added exhaustion for sprinting, walking, jumping and sprint-jumping as per MCPE (these use MCPE values, and yes MCPE does walking exhaustion!) - Fixed attributes don't get reset after player death - Added food and hunger regeneration in peaceful difficulty - Added API methods Living->jump() (motion isn't updated yet, so this won't actually do much if plugins try to use it) and Living->getJumpVelocity() TODO: implement exhaustion for swimming
This commit is contained in:
@ -165,6 +165,10 @@ class Attribute{
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function resetToDefault(){
|
||||
$this->setValue($this->getDefaultValue());
|
||||
}
|
||||
|
||||
public function getValue(){
|
||||
return $this->currentValue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user