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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Logger
private final ProcessorMailbox
<StrictQueue.IntRunnable> private final Map
<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 pChunkPos, StreamTagVisitor pVisitor) store
(ChunkPos pChunkPos, CompoundTag pChunkData) private void
private <T> CompletableFuture
<T> submitTask
(Supplier<com.mojang.datafixers.util.Either<T, Exception>> pTask) synchronize
(boolean pFlushStorage) private void
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
shutdownRequested
-
mailbox
-
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
-
loadAsync
-
synchronize
-
scanChunk
- Specified by:
scanChunk
in interfaceChunkScanAccess
-
submitTask
private <T> CompletableFuture<T> submitTask(Supplier<com.mojang.datafixers.util.Either<T, Exception>> pTask) -
storePendingChunk
private void storePendingChunk() -
tellStorePending
private void tellStorePending() -
runStore
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
storageInfo
-