add that thing
This commit is contained in:
parent
957f9f5998
commit
922a86d2b0
@ -163,7 +163,11 @@ bool ChunksController::buildLights(
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "util/timeutil.hpp"
|
||||
|
||||
void ChunksController::createChunk(const Player& player, int x, int z) const {
|
||||
timeutil::ScopeLogTimer log(111);
|
||||
|
||||
if (!player.isLoadingChunks()) {
|
||||
if (auto chunk = level.chunks->fetch(x, z)) {
|
||||
player.chunks->putChunk(chunk);
|
||||
|
||||
@ -89,13 +89,19 @@ static inline auto load_inventories(
|
||||
return invs;
|
||||
}
|
||||
|
||||
#include "util/timeutil.hpp"
|
||||
|
||||
std::shared_ptr<Chunk> GlobalChunks::create(int x, int z) {
|
||||
const auto& found = chunksMap.find(keyfrom(x, z));
|
||||
if (found != chunksMap.end()) {
|
||||
return found->second;
|
||||
}
|
||||
|
||||
auto chunk = std::make_shared<Chunk>(x, z);
|
||||
std::shared_ptr<Chunk> chunk;
|
||||
{
|
||||
timeutil::ScopeLogTimer log(555);
|
||||
chunk = std::make_shared<Chunk>(x, z);
|
||||
}
|
||||
chunksMap[keyfrom(x, z)] = chunk;
|
||||
|
||||
World& world = *level.getWorld();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user