Class IOWorker
- java.lang.Object
-
- net.minecraft.world.chunk.storage.IOWorker
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class IOWorker extends java.lang.Object implements java.lang.AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classIOWorker.Entry(package private) static classIOWorker.Priority
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.LoggerLOGGERprivate DelegatedTaskExecutor<ITaskQueue.RunnableWithPriority>mailboxprivate java.util.Map<ChunkPos,IOWorker.Entry>pendingWritesprivate java.util.concurrent.atomic.AtomicBooleanshutdownRequestedprivate RegionFileCachestorage
-
Constructor Summary
Constructors Modifier Constructor Description protectedIOWorker(java.io.File p_i231890_1_, boolean p_i231890_2_, java.lang.String p_i231890_3_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()CompoundNBTload(ChunkPos p_227090_1_)private voidrunStore(ChunkPos p_227091_1_, IOWorker.Entry p_227091_2_)java.util.concurrent.CompletableFuture<java.lang.Void>store(ChunkPos p_227093_1_, CompoundNBT p_227093_2_)private voidstorePendingChunk()private <T> java.util.concurrent.CompletableFuture<T>submitTask(java.util.function.Supplier<com.mojang.datafixers.util.Either<T,java.lang.Exception>> p_235975_1_)java.util.concurrent.CompletableFuture<java.lang.Void>synchronize()private voidtellStorePending()
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
shutdownRequested
private final java.util.concurrent.atomic.AtomicBoolean shutdownRequested
-
mailbox
private final DelegatedTaskExecutor<ITaskQueue.RunnableWithPriority> mailbox
-
storage
private final RegionFileCache storage
-
pendingWrites
private final java.util.Map<ChunkPos,IOWorker.Entry> pendingWrites
-
-
Method Detail
-
store
public java.util.concurrent.CompletableFuture<java.lang.Void> store(ChunkPos p_227093_1_, CompoundNBT p_227093_2_)
-
load
@Nullable public CompoundNBT load(ChunkPos p_227090_1_) throws java.io.IOException
- Throws:
java.io.IOException
-
synchronize
public java.util.concurrent.CompletableFuture<java.lang.Void> synchronize()
-
submitTask
private <T> java.util.concurrent.CompletableFuture<T> submitTask(java.util.function.Supplier<com.mojang.datafixers.util.Either<T,java.lang.Exception>> p_235975_1_)
-
storePendingChunk
private void storePendingChunk()
-
tellStorePending
private void tellStorePending()
-
runStore
private void runStore(ChunkPos p_227091_1_, IOWorker.Entry p_227091_2_)
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.io.IOException
-
-