net.minecraft.world.storage

public class SerializingRegionBasedStorage<R, P>

implements AutoCloseable

net.minecraft.world.level.chunk.storage.SectionStorage
net.minecraft.world.level.chunk.storage.SectionStorage
net.minecraft.class_4180
net.minecraft.world.storage.SerializingRegionBasedStorage

Field summary

Modifier and TypeField
private static final org.slf4j.Logger
LOGGER
LOGGER
field_18691
LOGGER
private static final String
SECTIONS_TAG
SECTIONS_TAG
field_31427
SECTIONS_KEY
private final VersionedChunkStorage
simpleRegionStorage
simpleRegionStorage
field_48759
storageAccess
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Optional<R>>
storage
storage
field_18692
loadedElements
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet
dirtyChunks
dirtyChunks
field_18693
unsavedElements
private final com.mojang.serialization.Codec<P>
codec
codec
field_24750
codec
private final Function<R, P>
packer
packer
field_52647
serializer
private final BiFunction<P, Runnable, R>
unpacker
unpacker
field_52648
deserializer
private final Function<Runnable, R>
factory
factory
field_18695
factory
private final DynamicRegistryManager
registryAccess
registryAccess
field_39315
registryManager
private final ChunkErrorHandler
errorReporter
errorReporter
field_52227
errorHandler
protected final HeightLimitView
levelHeightAccessor
levelHeightAccessor
field_27240
world
private final it.unimi.dsi.fastutil.longs.LongSet
loadedChunks
loadedChunks
field_52649
loadedChunks
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<CompletableFuture<Optional<SerializingRegionBasedStorage$LoadResult<P>>>>
pendingLoads
pendingLoads
field_52650
pendingLoads
private final Object
loadLock
loadLock
field_52651
lock

Constructor summary

ModifierConstructor
public (VersionedChunkStorage storageAccess, com.mojang.serialization.Codec<P> codec, Function<R, P> serializer, BiFunction<P, Runnable, R> deserializer, Function<Runnable, R> factory, DynamicRegistryManager registryManager, ChunkErrorHandler errorHandler, HeightLimitView world)

Method summary

Modifier and TypeMethod
protected void
tick(BooleanSupplier haveTime)
tick(BooleanSupplier haveTime)
method_19290(BooleanSupplier arg0)
tick(BooleanSupplier shouldKeepTicking)
private void
unpackPendingLoads()
unpackPendingLoads()
method_61786()
tickPendingLoads()
public void
flushAll()
flushAll()
method_61775()
save()
public boolean
hasWork()
hasWork()
method_40020()
hasUnsavedElements()
protected Optional<R>
get(long sectionPos)
get(long sectionPos)
method_19293(long arg0)
getIfLoaded(long pos)
protected Optional<R>
getOrLoad(long sectionPos)
getOrLoad(long sectionPos)
method_19294(long arg0)
get(long pos)
protected boolean
outsideStoredRange(long sectionPos)
outsideStoredRange(long sectionPos)
method_19292(long arg0)
isPosInvalid(long pos)
protected R
getOrCreate(long sectionPos)
getOrCreate(long sectionPos)
method_19295(long arg0)
getOrCreate(long pos)
public CompletableFuture<?>
prefetch(ChunkPos chunkPos)
prefetch(ChunkPos chunkPos)
method_61780(class_1923 arg0)
load(ChunkPos chunkPos)
private void
unpackChunk(ChunkPos chunkPos)
unpackChunk(ChunkPos chunkPos)
method_61787(class_1923 arg0)
loadAndWait(ChunkPos chunkPos)
private CompletableFuture<Optional<SerializingRegionBasedStorage$LoadResult<P>>>
tryRead(ChunkPos chunkPos)
tryRead(ChunkPos chunkPos)
method_20621(class_1923 arg0)
loadNbt(ChunkPos chunkPos)
private void
unpackChunk(ChunkPos pos, SectionStorage$PackedChunk<P> packedChunk)
unpackChunk(ChunkPos pos, SectionStorage$PackedChunk<P> packedChunk)
method_61782(class_1923 arg0, class_4180$class_9897<P> arg1)
onLoad(ChunkPos chunkPos, SerializingRegionBasedStorage$LoadResult<P> result)
private void
writeChunk(ChunkPos chunkPos)
writeChunk(ChunkPos chunkPos)
method_20370(class_1923 arg0)
save(ChunkPos pos)
private <T> com.mojang.serialization.Dynamic<T>
writeChunk(ChunkPos chunkPos, com.mojang.serialization.DynamicOps<T> ops)
writeChunk(ChunkPos chunkPos, com.mojang.serialization.DynamicOps<T> ops)
method_20367(class_1923 arg0, com.mojang.serialization.DynamicOps<T> arg1)
serialize(ChunkPos chunkPos, com.mojang.serialization.DynamicOps<T> ops)
private static long
getKey(ChunkPos chunkPos, int sectionY)
getKey(ChunkPos chunkPos, int sectionY)
method_33637(class_1923 arg0, int arg1)
chunkSectionPosAsLong(ChunkPos chunkPos, int y)
protected void
onSectionLoad(long sectionPos)
onSectionLoad(long sectionPos)
method_19291(long arg0)
onLoad(long pos)
protected void
setDirty(long sectionPos)
setDirty(long sectionPos)
method_19288(long arg0)
onUpdate(long pos)
public void
flush(ChunkPos chunkPos)
flush(ChunkPos chunkPos)
method_20436(class_1923 arg0)
saveChunk(ChunkPos pos)
public void
close()
close()