Fix (well, lower the chance of) reading regions that is actively being saved, reduce that chunk pos error chance.
This commit is contained in:
+1
-1
@@ -204,7 +204,7 @@ public class ChunkLoader
|
||||
ChunkPos actualPos = new ChunkPos(tagLevel.getInt("xPos"), tagLevel.getInt("zPos"));
|
||||
if (!Objects.equals(chunkPos, actualPos))
|
||||
{
|
||||
LOGGER.error("Chunk file at "+chunkPos+" is in the wrong location; Ignoring. (Expected "+chunkPos+", got "+actualPos+")");
|
||||
LOGGER.warn("Chunk file at "+chunkPos+" is in the wrong location; Ignoring. (Expected "+chunkPos+", got "+actualPos+")");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -47,16 +47,8 @@ public class RegionFileStorageExternalCache implements AutoCloseable {
|
||||
{
|
||||
long posLong = ChunkPos.asLong(pos.getRegionX(), pos.getRegionZ());
|
||||
RegionFile rFile;
|
||||
// First check our custom cache
|
||||
for (RegionFileCache cache : this.regionFileCache)
|
||||
{
|
||||
if (cache.pos == posLong)
|
||||
{
|
||||
return cache.file;
|
||||
}
|
||||
}
|
||||
|
||||
// Then check vanilla cache
|
||||
|
||||
// Check vanilla cache
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
@@ -74,6 +66,15 @@ public class RegionFileStorageExternalCache implements AutoCloseable {
|
||||
{
|
||||
return rFile;
|
||||
}
|
||||
|
||||
// Then check our custom cache
|
||||
for (RegionFileCache cache : this.regionFileCache)
|
||||
{
|
||||
if (cache.pos == posLong)
|
||||
{
|
||||
return cache.file;
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise, check if file exist, and if so, add it to the cache
|
||||
Path p = storage.folder;
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: d2bb99fb4b...25ba274a36
Reference in New Issue
Block a user