mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
painting fix, sleeping fix
This commit is contained in:
parent
385c8a1bc0
commit
d70d207317
3 changed files with 41 additions and 35 deletions
|
|
@ -107,7 +107,21 @@ class Level{
|
|||
unset($this->mobSpawner->level);
|
||||
}
|
||||
|
||||
|
||||
public function checkSleep(){ //TODO events?
|
||||
if(count($this->players) == 0) return false;
|
||||
if($this->server->api->time->getPhase($this->level) === "night"){ //TODO vanilla
|
||||
foreach($this->players as $p){
|
||||
if($p->isSleeping == false || $p->sleepingTime < 100){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->server->api->time->set("day", $this->level);
|
||||
}
|
||||
foreach($this->players as $p){
|
||||
$p->stopSleep();
|
||||
}
|
||||
}
|
||||
|
||||
public function getOrderedFullChunk($X, $Z){
|
||||
$X = (int)$X;
|
||||
$Z = (int)$Z;
|
||||
|
|
@ -293,7 +307,7 @@ class Level{
|
|||
}
|
||||
$now = microtime(true);
|
||||
$this->players = $this->server->api->player->getAll($this);
|
||||
|
||||
$this->checkSleep();
|
||||
if(count($this->changedCount) > 0){
|
||||
arsort($this->changedCount);
|
||||
$resendChunks = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue