Class RegionSectionCache<R>

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    PointOfInterestManager

    public class RegionSectionCache<R>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.function.Function<java.lang.Runnable,​com.mojang.serialization.Codec<R>> codec  
      private it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet dirty  
      private java.util.function.Function<java.lang.Runnable,​R> factory  
      private com.mojang.datafixers.DataFixer fixerUpper  
      private static org.apache.logging.log4j.Logger LOGGER  
      private it.unimi.dsi.fastutil.longs.Long2ObjectMap<java.util.Optional<R>> storage  
      private DefaultTypeReferences type  
      private IOWorker worker  
    • Constructor Summary

      Constructors 
      Constructor Description
      RegionSectionCache​(java.io.File p_i231897_1_, java.util.function.Function<java.lang.Runnable,​com.mojang.serialization.Codec<R>> p_i231897_2_, java.util.function.Function<java.lang.Runnable,​R> p_i231897_3_, com.mojang.datafixers.DataFixer p_i231897_4_, DefaultTypeReferences p_i231897_5_, boolean p_i231897_6_)  
    • Field Detail

      • LOGGER

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

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

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

        private final java.util.function.Function<java.lang.Runnable,​com.mojang.serialization.Codec<R>> codec
      • factory

        private final java.util.function.Function<java.lang.Runnable,​R> factory
      • fixerUpper

        private final com.mojang.datafixers.DataFixer fixerUpper
    • Constructor Detail

      • RegionSectionCache

        public RegionSectionCache​(java.io.File p_i231897_1_,
                                  java.util.function.Function<java.lang.Runnable,​com.mojang.serialization.Codec<R>> p_i231897_2_,
                                  java.util.function.Function<java.lang.Runnable,​R> p_i231897_3_,
                                  com.mojang.datafixers.DataFixer p_i231897_4_,
                                  DefaultTypeReferences p_i231897_5_,
                                  boolean p_i231897_6_)
    • Method Detail

      • tick

        protected void tick​(java.util.function.BooleanSupplier p_219115_1_)
      • get

        @Nullable
        protected java.util.Optional<R> get​(long p_219106_1_)
      • getOrLoad

        protected java.util.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_)
      • 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 java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.io.IOException