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 class
IOWorker.Entry
(package private) static class
IOWorker.Priority
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.Logger
LOGGER
private DelegatedTaskExecutor<ITaskQueue.RunnableWithPriority>
mailbox
private java.util.Map<ChunkPos,IOWorker.Entry>
pendingWrites
private java.util.concurrent.atomic.AtomicBoolean
shutdownRequested
private RegionFileCache
storage
-
Constructor Summary
Constructors Modifier Constructor Description protected
IOWorker(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 void
close()
CompoundNBT
load(ChunkPos p_227090_1_)
private void
runStore(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 void
storePendingChunk()
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 void
tellStorePending()
-
-
-
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:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.io.IOException
-
-