mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 12:48:32 +00:00
World: make less noise about deleted tile entities
no need to repeat the same message 100 times
This commit is contained in:
parent
035d2dec23
commit
56da492e48
@ -2982,6 +2982,8 @@ class World implements ChunkManager{
|
|||||||
if(count($chunkData->getEntityNBT()) !== 0){
|
if(count($chunkData->getEntityNBT()) !== 0){
|
||||||
$this->timings->syncChunkLoadEntities->startTiming();
|
$this->timings->syncChunkLoadEntities->startTiming();
|
||||||
$entityFactory = EntityFactory::getInstance();
|
$entityFactory = EntityFactory::getInstance();
|
||||||
|
|
||||||
|
$deletedEntities = [];
|
||||||
foreach($chunkData->getEntityNBT() as $k => $nbt){
|
foreach($chunkData->getEntityNBT() as $k => $nbt){
|
||||||
try{
|
try{
|
||||||
$entity = $entityFactory->createFromData($this, $nbt);
|
$entity = $entityFactory->createFromData($this, $nbt);
|
||||||
@ -2998,18 +3000,23 @@ class World implements ChunkManager{
|
|||||||
}elseif($saveIdTag instanceof IntTag){ //legacy MCPE format
|
}elseif($saveIdTag instanceof IntTag){ //legacy MCPE format
|
||||||
$saveId = "legacy(" . $saveIdTag->getValue() . ")";
|
$saveId = "legacy(" . $saveIdTag->getValue() . ")";
|
||||||
}
|
}
|
||||||
$logger->warning("Deleted unknown entity type $saveId");
|
$deletedEntities[$saveId] = ($deletedEntities[$saveId] ?? 0) + 1;
|
||||||
}
|
}
|
||||||
//TODO: we can't prevent entities getting added to unloaded chunks if they were saved in the wrong place
|
//TODO: we can't prevent entities getting added to unloaded chunks if they were saved in the wrong place
|
||||||
//here, because entities currently add themselves to the world
|
//here, because entities currently add themselves to the world
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach(Utils::promoteKeys($deletedEntities) as $saveId => $count){
|
||||||
|
$logger->warning("Deleted unknown entity type $saveId x$count");
|
||||||
|
}
|
||||||
$this->timings->syncChunkLoadEntities->stopTiming();
|
$this->timings->syncChunkLoadEntities->stopTiming();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($chunkData->getTileNBT()) !== 0){
|
if(count($chunkData->getTileNBT()) !== 0){
|
||||||
$this->timings->syncChunkLoadTileEntities->startTiming();
|
$this->timings->syncChunkLoadTileEntities->startTiming();
|
||||||
$tileFactory = TileFactory::getInstance();
|
$tileFactory = TileFactory::getInstance();
|
||||||
|
|
||||||
|
$deletedTiles = [];
|
||||||
foreach($chunkData->getTileNBT() as $k => $nbt){
|
foreach($chunkData->getTileNBT() as $k => $nbt){
|
||||||
try{
|
try{
|
||||||
$tile = $tileFactory->createFromData($this, $nbt);
|
$tile = $tileFactory->createFromData($this, $nbt);
|
||||||
@ -3019,7 +3026,8 @@ class World implements ChunkManager{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if($tile === null){
|
if($tile === null){
|
||||||
$logger->warning("Deleted unknown tile entity type " . $nbt->getString("id", "<unknown>"));
|
$saveId = $nbt->getString("id", "<unknown>");
|
||||||
|
$deletedTiles[$saveId] = ($deletedTiles[$saveId] ?? 0) + 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3035,6 +3043,10 @@ class World implements ChunkManager{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach(Utils::promoteKeys($deletedTiles) as $saveId => $count){
|
||||||
|
$logger->warning("Deleted unknown tile entity type $saveId x$count");
|
||||||
|
}
|
||||||
|
|
||||||
$this->timings->syncChunkLoadTileEntities->stopTiming();
|
$this->timings->syncChunkLoadTileEntities->stopTiming();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user