Class RegionSectionCache<R>

java.lang.Object
net.minecraft.world.chunk.storage.RegionSectionCache<R>
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
PointOfInterestManager

public class RegionSectionCache<R> extends Object implements AutoCloseable
  • Field Details

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • worker

      private final IOWorker worker
    • storage

      private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Optional<R>> storage
    • dirty

      private final it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet dirty
    • codec

      private final Function<Runnable,com.mojang.serialization.Codec<R>> codec
    • factory

      private final Function<Runnable,R> factory
    • fixerUpper

      private final com.mojang.datafixers.DataFixer fixerUpper
    • type

      private final DefaultTypeReferences type
  • Constructor Details

  • Method Details

    • tick

      protected void tick(BooleanSupplier p_219115_1_)
    • get

      @Nullable protected Optional<R> get(long p_219106_1_)
    • getOrLoad

      protected Optional<R> getOrLoad(long p_219113_1_)
    • outsideStoredRange

      protected boolean outsideStoredRange(SectionPos p_219114_1_)
    • getOrCreate

      protected R getOrCreate(long p_235995_1_)
    • readColumn

      private void readColumn(ChunkPos p_219107_1_)
    • tryRead

      @Nullable private CompoundNBT tryRead(ChunkPos p_223138_1_)
    • readColumn

      private <T> void readColumn(ChunkPos p_235992_1_, com.mojang.serialization.DynamicOps<T> p_235992_2_, @Nullable T p_235992_3_)
    • writeColumn

      private void writeColumn(ChunkPos p_219117_1_)
    • writeColumn

      private <T> com.mojang.serialization.Dynamic<T> writeColumn(ChunkPos p_235991_1_, com.mojang.serialization.DynamicOps<T> p_235991_2_)
    • onSectionLoad

      protected void onSectionLoad(long p_219111_1_)
    • setDirty

      protected void setDirty(long p_219116_1_)
    • getVersion

      private static int getVersion(com.mojang.serialization.Dynamic<?> p_235993_0_)
    • flush

      public void flush(ChunkPos p_219112_1_)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException