Class ChunkManager

    • Field Detail

      • LOGGER

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

        public static final int MAX_CHUNK_DISTANCE
      • updatingChunkMap

        private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> updatingChunkMap
      • visibleChunkMap

        private volatile it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> visibleChunkMap
      • pendingUnloads

        private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkHolder> pendingUnloads
      • entitiesInLevel

        private final it.unimi.dsi.fastutil.longs.LongSet entitiesInLevel
      • mainThreadExecutor

        private final ThreadTaskExecutor<java.lang.Runnable> mainThreadExecutor
      • toDrop

        private final it.unimi.dsi.fastutil.longs.LongSet toDrop
      • modified

        private boolean modified
      • tickingGenerated

        private final java.util.concurrent.atomic.AtomicInteger tickingGenerated
      • storageFolder

        private final java.io.File storageFolder
      • chunkTypeCache

        private final it.unimi.dsi.fastutil.longs.Long2ByteMap chunkTypeCache
      • unloadQueue

        private final java.util.Queue<java.lang.Runnable> unloadQueue
      • viewDistance

        private int viewDistance
    • Method Detail

      • euclideanDistanceSquared

        private static double euclideanDistanceSquared​(ChunkPos p_219217_0_,
                                                       Entity p_219217_1_)
      • checkerboardDistance

        private static int checkerboardDistance​(ChunkPos p_219215_0_,
                                                ServerPlayerEntity p_219215_1_,
                                                boolean p_219215_2_)
      • checkerboardDistance

        private static int checkerboardDistance​(ChunkPos p_219232_0_,
                                                int p_219232_1_,
                                                int p_219232_2_)
      • getUpdatingChunkIfPresent

        @Nullable
        protected ChunkHolder getUpdatingChunkIfPresent​(long p_219220_1_)
      • getVisibleChunkIfPresent

        @Nullable
        protected ChunkHolder getVisibleChunkIfPresent​(long p_219219_1_)
      • getChunkQueueLevel

        protected java.util.function.IntSupplier getChunkQueueLevel​(long p_219191_1_)
      • getChunkDebugData

        public java.lang.String getChunkDebugData​(ChunkPos p_219170_1_)
      • getChunkRangeFuture

        private java.util.concurrent.CompletableFuture<com.mojang.datafixers.util.Either<java.util.List<IChunk>,​ChunkHolder.IChunkLoadingError>> getChunkRangeFuture​(ChunkPos p_219236_1_,
                                                                                                                                                                           int p_219236_2_,
                                                                                                                                                                           java.util.function.IntFunction<ChunkStatus> p_219236_3_)
      • updateChunkScheduling

        @Nullable
        private ChunkHolder updateChunkScheduling​(long p_219213_1_,
                                                  int p_219213_3_,
                                                  @Nullable
                                                  ChunkHolder p_219213_4_,
                                                  int p_219213_5_)
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class ChunkLoader
        Throws:
        java.io.IOException
      • saveAllChunks

        protected void saveAllChunks​(boolean p_219177_1_)
      • tick

        protected void tick​(java.util.function.BooleanSupplier p_219204_1_)
      • processUnloads

        private void processUnloads​(java.util.function.BooleanSupplier p_223155_1_)
      • scheduleUnload

        private void scheduleUnload​(long p_219212_1_,
                                    ChunkHolder p_219212_3_)
      • promoteChunkMap

        protected boolean promoteChunkMap()
      • markPositionReplaceable

        private void markPositionReplaceable​(ChunkPos p_241089_1_)
      • releaseLightTicket

        protected void releaseLightTicket​(ChunkPos p_219209_1_)
      • getDependencyStatus

        private ChunkStatus getDependencyStatus​(ChunkStatus p_219205_1_,
                                                int p_219205_2_)
      • getTickingGenerated

        public int getTickingGenerated()
      • save

        private boolean save​(IChunk p_219229_1_)
      • isExistingChunkFull

        private boolean isExistingChunkFull​(ChunkPos p_241090_1_)
      • setViewDistance

        protected void setViewDistance​(int p_219175_1_)
      • updateChunkTracking

        protected void updateChunkTracking​(ServerPlayerEntity p_219199_1_,
                                           ChunkPos p_219199_2_,
                                           IPacket<?>[] p_219199_3_,
                                           boolean p_219199_4_,
                                           boolean p_219199_5_)
      • size

        public int size()
      • getChunks

        protected java.lang.Iterable<ChunkHolder> getChunks()
      • dumpChunks

        void dumpChunks​(java.io.Writer p_225406_1_)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • printFuture

        private static java.lang.String printFuture​(java.util.concurrent.CompletableFuture<com.mojang.datafixers.util.Either<Chunk,​ChunkHolder.IChunkLoadingError>> p_225402_0_)
      • readChunk

        @Nullable
        private CompoundNBT readChunk​(ChunkPos p_219178_1_)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • noPlayersCloseForSpawning

        boolean noPlayersCloseForSpawning​(ChunkPos p_219243_1_)
      • updatePlayerStatus

        void updatePlayerStatus​(ServerPlayerEntity p_219234_1_,
                                boolean p_219234_2_)
      • addEntity

        protected void addEntity​(Entity p_219210_1_)
      • removeEntity

        protected void removeEntity​(Entity p_219231_1_)
      • tick

        protected void tick()
      • broadcast

        protected void broadcast​(Entity p_219222_1_,
                                 IPacket<?> p_219222_2_)
      • broadcastAndSend

        protected void broadcastAndSend​(Entity p_219225_1_,
                                        IPacket<?> p_219225_2_)
      • packTicks

        public java.util.concurrent.CompletableFuture<java.lang.Void> packTicks​(Chunk p_222973_1_)