Skip to content

Commit 00fc292

Browse files
committed
Skip map_*.dat files when loading structures to improve world load time
Worlds with thousands of in-game maps (map_<id>.dat) were slow to load because loadStructures() parsed every .dat file in data/, even though map files never contain structure data.
1 parent fb7b873 commit 00fc292

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

minutor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,8 @@ void Minutor::loadStructures(QDir path) {
11941194
// attempt to parse all of the files in the data directory, looking for
11951195
// generated structures
11961196
for (auto &fileName : path.entryList(QStringList() << "*.dat")) {
1197+
if (fileName.startsWith("map_")) // map files don't contain structures
1198+
continue;
11971199
NBT file(path.filePath(fileName));
11981200
auto data = file.at("data");
11991201

0 commit comments

Comments
 (0)