net.minecraft.world.storage

public class SerializingRegionBasedStorage<R, P>

implements AutoCloseable

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
field_18691
LOGGER
private static final String
SECTIONS_TAG
field_31427
SECTIONS_KEY
private final VersionedChunkStorage
simpleRegionStorage
field_48759
storageAccess
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Optional<R>>
storage
field_18692
loadedElements
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet
dirtyChunks
field_18693
unsavedElements
private final com.mojang.serialization.Codec<P>
codec
field_24750
codec
private final Function<R, P>
packer
field_52647
serializer
private final BiFunction<P, Runnable, R>
unpacker
field_52648
deserializer
private final Function<Runnable, R>
factory
field_18695
factory
private final DynamicRegistryManager
registryAccess
field_39315
registryManager
private final ChunkErrorHandler
errorReporter
field_52227
errorHandler
protected final HeightLimitView
levelHeightAccessor
field_27240
world
private final it.unimi.dsi.fastutil.longs.LongSet
loadedChunks
field_52649
loadedChunks
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<CompletableFuture<Optional<SerializingRegionBasedStorage$LoadResult<P>>>>
pendingLoads
field_52650
pendingLoads
private final Object
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)
method_19290(BooleanSupplier arg0)
tick(BooleanSupplier shouldKeepTicking)
private void
unpackPendingLoads()
method_61786()
tickPendingLoads()
public void
flushAll()
method_61775()
save()
public boolean
hasWork()
method_40020()
hasUnsavedElements()
protected Optional<R>
get(long sectionPos)
method_19293(long arg0)
getIfLoaded(long pos)
protected Optional<R>
getOrLoad(long sectionPos)
method_19294(long arg0)
get(long pos)
protected boolean
outsideStoredRange(long sectionPos)
method_19292(long arg0)
isPosInvalid(long pos)
protected R
getOrCreate(long sectionPos)
method_19295(long arg0)
getOrCreate(long pos)
public CompletableFuture<?>
prefetch(ChunkPos chunkPos)
method_61780(class_1923 arg0)
load(ChunkPos chunkPos)
private void
unpackChunk(ChunkPos chunkPos)
method_61787(class_1923 arg0)
loadAndWait(ChunkPos chunkPos)
private CompletableFuture<Optional<SerializingRegionBasedStorage$LoadResult<P>>>
tryRead(ChunkPos chunkPos)
method_20621(class_1923 arg0)
loadNbt(ChunkPos chunkPos)
private void
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)
method_20370(class_1923 arg0)
save(ChunkPos pos)
private <T> com.mojang.serialization.Dynamic<T>
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)
method_33637(class_1923 arg0, int arg1)
chunkSectionPosAsLong(ChunkPos chunkPos, int y)
protected void
onSectionLoad(long sectionPos)
method_19291(long arg0)
onLoad(long pos)
protected void
setDirty(long sectionPos)
method_19288(long arg0)
onUpdate(long pos)
public void
flush(ChunkPos chunkPos)
method_20436(class_1923 arg0)
saveChunk(ChunkPos pos)
public void
close()
private static void
lambda$writeChunk$11(Map arg0, com.mojang.serialization.DynamicOps arg1, String arg2, Object arg3)
method_61784(Map arg0, com.mojang.serialization.DynamicOps arg1, String arg2, Object arg3)
method_61784(Map arg0, com.mojang.serialization.DynamicOps arg1, String arg2, Object value)
private Void
lambda$writeChunk$10(ChunkPos arg0, Throwable arg1)
method_61783(class_1923 arg0, Throwable arg1)
method_61783(ChunkPos arg0, Throwable throwable)
private void
lambda$unpackChunk$9(long arg0, boolean arg1, Object arg2)
method_61777(long arg0, boolean arg1, Object arg2)
method_61777(long arg0, boolean arg1, Object arg2)
private Object
lambda$unpackChunk$8(long arg0, Object arg1)
method_61776(long arg0, Object arg1)
method_61776(long arg0, Object section)
private void
lambda$unpackChunk$7(long arg0)
method_61788(long arg0)
method_61788(long arg0)
private Optional
lambda$tryRead$6(ChunkPos arg0, Throwable arg1)
method_43412(class_1923 arg0, Throwable arg1)
method_43412(ChunkPos arg0, Throwable throwable)
private Optional
lambda$tryRead$5(RegistryOps arg0, Optional arg1)
method_61778(class_6903 arg0, Optional arg1)
method_61778(RegistryOps arg0, Optional chunkNbt)
private SerializingRegionBasedStorage$LoadResult
lambda$tryRead$4(RegistryOps arg0, CompoundTag arg1)
method_61779(class_6903 arg0, class_2487 arg1)
method_61779(RegistryOps arg0, NbtCompound nbt)
private CompletableFuture
lambda$unpackChunk$3(ChunkPos arg0, long arg1)
method_61781(class_1923 arg0, long arg1)
method_61781(ChunkPos arg0, long pos)
private CompletableFuture
lambda$prefetch$2(ChunkPos arg0, long arg1)
method_61785(class_1923 arg0, long arg1)
method_61785(ChunkPos arg0, long pos)
private void
lambda$getOrCreate$1(long arg0)
method_19297(long arg0)
method_19297(long arg0)
private void
lambda$flushAll$0(long arg0)
method_61789(long arg0)
method_61789(long chunkPos)