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 pSimpleRegionStorage, Function<Runnable, com.mojang.serialization.Codec<R>> pCodec, Function<Runnable, R> pFactory, RegistryAccess pRegistryAccess, ChunkIOErrorReporter pErrorReporter, LevelHeightAccessor pLevelHeightAccessor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidget(long pSectionKey) private static longprotected RgetOrCreate(long pSectionKey) getOrLoad(long pSectionKey) private static intgetVersion(com.mojang.serialization.Dynamic<?> pColumnData) booleanhasWork()protected voidonSectionLoad(long pSectionKey) protected booleanoutsideStoredRange(long pSectionKey) private voidreadColumn(ChunkPos pChunkPos) private voidreadColumn(ChunkPos pChunkPos, RegistryOps<Tag> pOps, CompoundTag pTag) voidremove(long sectionPosAsLong) Neo: Removes the data for the given chunk position.protected voidsetDirty(long pSectionPos) protected voidtick(BooleanSupplier pAheadOfTime) private CompletableFuture<Optional<CompoundTag>> private voidwriteColumn(ChunkPos pChunkPos) private <T> com.mojang.serialization.Dynamic<T> writeColumn(ChunkPos pChunkPos, com.mojang.serialization.DynamicOps<T> pOps)
-
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 pSimpleRegionStorage, Function<Runnable, com.mojang.serialization.Codec<R>> pCodec, Function<Runnable, R> pFactory, RegistryAccess pRegistryAccess, ChunkIOErrorReporter pErrorReporter, LevelHeightAccessor pLevelHeightAccessor)
-
-
Method Details
-
tick
-
hasWork
public boolean hasWork() -
get
-
getOrLoad
-
outsideStoredRange
protected boolean outsideStoredRange(long pSectionKey) -
getOrCreate
-
readColumn
-
tryRead
-
readColumn
-
writeColumn
-
writeColumn
private <T> com.mojang.serialization.Dynamic<T> writeColumn(ChunkPos pChunkPos, com.mojang.serialization.DynamicOps<T> pOps) -
getKey
-
onSectionLoad
protected void onSectionLoad(long pSectionKey) -
setDirty
protected void setDirty(long pSectionPos) -
getVersion
private static int getVersion(com.mojang.serialization.Dynamic<?> pColumnData) -
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
-