Class SectionStorage<R>
java.lang.Object
net.minecraft.world.level.chunk.storage.SectionStorage<R>
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
PoiManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSetprivate final ChunkIOErrorReporterprotected final LevelHeightAccessorprivate static final org.slf4j.Loggerprivate final RegistryAccessprivate static final Stringprivate final SimpleRegionStorage -
Constructor Summary
ConstructorsConstructorDescriptionSectionStorage(SimpleRegionStorage simpleRegionStorage, Function<Runnable, com.mojang.serialization.Codec<R>> codec, Function<Runnable, R> factory, RegistryAccess registryAccess, ChunkIOErrorReporter errorReporter, LevelHeightAccessor levelHeightAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidget(long sectionKey) private static longprotected RgetOrCreate(long sectionKey) getOrLoad(long sectionKey) private static intgetVersion(com.mojang.serialization.Dynamic<?> columnData) booleanhasWork()protected voidonSectionLoad(long sectionKey) protected booleanoutsideStoredRange(long sectionKey) private voidreadColumn(ChunkPos chunkPos) private voidreadColumn(ChunkPos chunkPos, RegistryOps<Tag> ops, CompoundTag tag) voidremove(long sectionPosAsLong) Neo: Removes the data for the given chunk position.protected voidsetDirty(long sectionPos) protected voidtick(BooleanSupplier aheadOfTime) private CompletableFuture<Optional<CompoundTag>> private voidwriteColumn(ChunkPos chunkPos) private <T> com.mojang.serialization.Dynamic<T> writeColumn(ChunkPos chunkPos, com.mojang.serialization.DynamicOps<T> ops)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SECTIONS_TAG
- See Also:
-
simpleRegionStorage
-
storage
-
dirty
private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet dirty -
codec
-
factory
-
registryAccess
-
errorReporter
-
levelHeightAccessor
-
-
Constructor Details
-
SectionStorage
public SectionStorage(SimpleRegionStorage simpleRegionStorage, Function<Runnable, com.mojang.serialization.Codec<R>> codec, Function<Runnable, R> factory, RegistryAccess registryAccess, ChunkIOErrorReporter errorReporter, LevelHeightAccessor levelHeightAccessor)
-
-
Method Details
-
tick
-
hasWork
public boolean hasWork() -
get
-
getOrLoad
-
outsideStoredRange
protected boolean outsideStoredRange(long sectionKey) -
getOrCreate
-
readColumn
-
tryRead
-
readColumn
-
writeColumn
-
writeColumn
private <T> com.mojang.serialization.Dynamic<T> writeColumn(ChunkPos chunkPos, com.mojang.serialization.DynamicOps<T> ops) -
getKey
-
onSectionLoad
protected void onSectionLoad(long sectionKey) -
setDirty
protected void setDirty(long sectionPos) -
getVersion
private static int getVersion(com.mojang.serialization.Dynamic<?> columnData) -
flush
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
remove
public void remove(long sectionPosAsLong) Neo: Removes the data for the given chunk position. See PR #937
-