Server: Account for later levels being unloaded by earlier levels' ticking function in checkTickUpdates()

should fix #2434

This happens when a plugin causes a level to be unloaded during an event fired on level tick.
This commit is contained in:
Dylan K. Taylor 2018-09-14 11:05:51 +01:00
parent 7d0e631a75
commit 06c4f31db7

View File

@ -2352,7 +2352,11 @@ class Server{
}
//Do level ticks
foreach($this->getLevels() as $level){
foreach($this->levels as $k => $level){
if(!isset($this->levels[$k])){
// Level unloaded during the tick of a level earlier in this loop, perhaps by plugin
continue;
}
if($level->getTickRate() > $this->baseTickRate and --$level->tickRateCounter > 0){
continue;
}