Extract MainLoggerThread unit from MainLogger

MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
This commit is contained in:
Dylan K. Taylor
2021-02-04 16:28:49 +00:00
parent 4b9639f6c9
commit ae75d73f48
13 changed files with 140 additions and 79 deletions

View File

@ -21,14 +21,14 @@
declare(strict_types=1);
require dirname(__DIR__, 3) . '/vendor/autoload.php';
require \dirname(__DIR__, 3) . '/vendor/autoload.php';
/* This script needs to be re-run after any intentional blockfactory change (adding or removing a block state). */
$factory = new \pocketmine\block\BlockFactory();
$old = json_decode(file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true);
$new = array_map(
$old = \json_decode(\file_get_contents(__DIR__ . '/block_factory_consistency_check.json'), true);
$new = \array_map(
function(\pocketmine\block\Block $block) : string{
return $block->getName();
},
@ -46,6 +46,6 @@ foreach($new as $k => $name){
echo "Name changed (" . ($k >> 4) . ":" . ($k & 0xf) . "): " . $old[$k] . " -> " . $name . "\n";
}
}
file_put_contents(__DIR__ . '/block_factory_consistency_check.json', json_encode(
\file_put_contents(__DIR__ . '/block_factory_consistency_check.json', \json_encode(
$new
));