Class IOWorker
java.lang.Object
net.minecraft.world.level.chunk.storage.IOWorker
- All Implemented Interfaces:
AutoCloseable
,ChunkScanAccess
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
(package private) static enum
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PriorityConsecutiveExecutor
private static final org.slf4j.Logger
private final SequencedMap
<ChunkPos, IOWorker.PendingStore> private static final int
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap
<CompletableFuture<BitSet>> private final AtomicBoolean
private final RegionFileStorage
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
IOWorker
(RegionStorageInfo pInfo, Path pFolder, boolean pSync) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
private CompletableFuture
<BitSet> createOldDataForRegion
(int pChunkX, int pChunkZ) private CompletableFuture
<BitSet> getOrCreateOldDataForRegion
(int pChunkX, int pChunkZ) private boolean
isOldChunk
(CompoundTag pChunkData) boolean
isOldChunkAround
(ChunkPos pChunkPos, int pRadius) private void
runStore
(ChunkPos pChunkPos, IOWorker.PendingStore pPendingStore) scanChunk
(ChunkPos p_196939_, StreamTagVisitor p_196940_) store
(ChunkPos pChunkPos, Supplier<CompoundTag> pDataSupplier) store
(ChunkPos pChunkPos, CompoundTag pChunkData) private void
private <T> CompletableFuture
<T> submitTask
(Supplier<T> pTask) private <T> CompletableFuture
<T> submitThrowingTask
(IOWorker.ThrowingSupplier<T> pTask) synchronize
(boolean pFlushStorage) private void
private void
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
shutdownRequested
-
consecutiveExecutor
-
storage
-
pendingWrites
-
regionCacheForBlender
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<CompletableFuture<BitSet>> regionCacheForBlender -
REGION_CACHE_SIZE
private static final int REGION_CACHE_SIZE- See Also:
-
-
Constructor Details
-
IOWorker
-
-
Method Details
-
isOldChunkAround
-
getOrCreateOldDataForRegion
-
createOldDataForRegion
-
isOldChunk
-
store
-
store
-
loadAsync
-
synchronize
-
scanChunk
- Specified by:
scanChunk
in interfaceChunkScanAccess
-
submitThrowingTask
-
submitTask
-
storePendingChunk
private void storePendingChunk() -
tellStorePending
private void tellStorePending() -
runStore
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
waitForShutdown
private void waitForShutdown() -
storageInfo
-