mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
fixed regeneration on difficulty 0
This commit is contained in:
parent
9f5386fd08
commit
a10c6a1d57
2 changed files with 7 additions and 18 deletions
|
|
@ -1398,6 +1398,13 @@ class Player{
|
|||
}
|
||||
public function entityTick(){
|
||||
if($this->isSleeping) ++$this->sleepingTime;
|
||||
|
||||
if($this->server->difficulty == 0 && $this->entity->counter % (20 * 15) == 0){
|
||||
if($this->entity->health < 20 && $this->entity->health > 0){
|
||||
$this->entity->setHealth(min(20, $this->entity->health + 1), "regeneration");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public function handleDataPacket(RakNetDataPacket $packet){
|
||||
if($this->connected === false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue