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