mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 11:26:37 +00:00
RegionWorldProvider: use provider logger instead of global logger
This commit is contained in:
parent
5fcf5e0c40
commit
4d0cecbac2
@ -118,12 +118,11 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
|
|||||||
try{
|
try{
|
||||||
$this->regions[$index] = RegionLoader::loadExisting($path);
|
$this->regions[$index] = RegionLoader::loadExisting($path);
|
||||||
}catch(CorruptedRegionException $e){
|
}catch(CorruptedRegionException $e){
|
||||||
$logger = \GlobalLogger::get();
|
$this->logger->error("Corrupted region file detected: " . $e->getMessage());
|
||||||
$logger->error("Corrupted region file detected: " . $e->getMessage());
|
|
||||||
|
|
||||||
$backupPath = $path . ".bak." . time();
|
$backupPath = $path . ".bak." . time();
|
||||||
rename($path, $backupPath);
|
rename($path, $backupPath);
|
||||||
$logger->error("Corrupted region file has been backed up to " . $backupPath);
|
$this->logger->error("Corrupted region file has been backed up to " . $backupPath);
|
||||||
|
|
||||||
$this->regions[$index] = RegionLoader::createNew($path);
|
$this->regions[$index] = RegionLoader::createNew($path);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user