mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-02 16:23:04 +00:00
Human: don't hardcode max food
This commit is contained in:
@ -641,7 +641,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($difficulty === Level::DIFFICULTY_PEACEFUL and $this->foodTickTimer % 10 === 0){
|
if($difficulty === Level::DIFFICULTY_PEACEFUL and $this->foodTickTimer % 10 === 0){
|
||||||
if($food < 20){
|
if($food < $this->getMaxFood()){
|
||||||
$this->addFood(1.0);
|
$this->addFood(1.0);
|
||||||
$food = $this->getFood();
|
$food = $this->getFood();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user