mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Fixed excessive idle CPU usage for chunk ticking
"excessive" = 5%, after changes = 1.6% - YMMV, but that's my machine.
This commit is contained in:
@ -47,6 +47,7 @@ use pocketmine\event\Timings;
|
|||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\item\ItemFactory;
|
use pocketmine\item\ItemFactory;
|
||||||
use pocketmine\level\format\Chunk;
|
use pocketmine\level\format\Chunk;
|
||||||
|
use pocketmine\level\format\EmptySubChunk;
|
||||||
use pocketmine\level\format\io\BaseLevelProvider;
|
use pocketmine\level\format\io\BaseLevelProvider;
|
||||||
use pocketmine\level\format\io\LevelProvider;
|
use pocketmine\level\format\io\LevelProvider;
|
||||||
use pocketmine\level\generator\GenerationTask;
|
use pocketmine\level\generator\GenerationTask;
|
||||||
@ -956,7 +957,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
|
|
||||||
|
|
||||||
foreach($chunk->getSubChunks() as $Y => $subChunk){
|
foreach($chunk->getSubChunks() as $Y => $subChunk){
|
||||||
if(!$subChunk->isEmpty()){
|
if(!($subChunk instanceof EmptySubChunk)){
|
||||||
for($i = 0; $i < 3; ++$i){
|
for($i = 0; $i < 3; ++$i){
|
||||||
$k = mt_rand(0, 0xfff);
|
$k = mt_rand(0, 0xfff);
|
||||||
$x = $k & 0x0f;
|
$x = $k & 0x0f;
|
||||||
|
Reference in New Issue
Block a user