Class DistanceManager
java.lang.Object
net.minecraft.server.level.DistanceManager
- Direct Known Subclasses:
ChunkMap.DistanceManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<ChunkHolder> private final LoadingChunkTrackerprivate static final org.slf4j.Loggerprivate final Executorprivate final DistanceManager.FixedPlayerDistanceChunkTrackerprivate static final intprivate final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayer>> private final DistanceManager.PlayerTicketTrackerprivate final SimulationChunkTrackerprivate intprivate final ThrottlingChunkTaskDispatcherprivate final TicketStorageprivate final it.unimi.dsi.fastutil.longs.LongSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDistanceManager(TicketStorage ticketStorage, Executor executor, Executor mainThreadExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlayer(SectionPos pos, ServerPlayer player) voidforEachEntityTickingChunk(it.unimi.dsi.fastutil.longs.LongConsumer consumer) protected abstract @Nullable ChunkHoldergetChunk(long node) intgetChunkLevel(long key, boolean simulation) intprivate intit.unimi.dsi.fastutil.longs.LongIteratorhasPlayersNearby(long pos) booleanbooleaninBlockTickingRange(long key) booleaninEntityTickingRange(long key) protected abstract booleanisChunkToRemove(long node) voidremovePlayer(SectionPos pos, ServerPlayer player) booleanrunAllUpdates(ChunkMap scheduler) protected abstract @Nullable ChunkHolderupdateChunkScheduling(long node, int level, @Nullable ChunkHolder chunk, int oldLevel) protected voidupdatePlayerTickets(int viewDistance) voidupdateSimulationDistance(int newDistance)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
PLAYER_TICKET_LEVEL
private static final int PLAYER_TICKET_LEVEL -
playersPerChunk
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayer>> playersPerChunk -
loadingChunkTracker
-
simulationChunkTracker
-
ticketStorage
-
naturalSpawnChunkCounter
-
playerTicketManager
-
chunksToUpdateFutures
-
ticketDispatcher
-
ticketsToRelease
private final it.unimi.dsi.fastutil.longs.LongSet ticketsToRelease -
mainThreadExecutor
-
simulationDistance
private int simulationDistance
-
-
Constructor Details
-
DistanceManager
protected DistanceManager(TicketStorage ticketStorage, Executor executor, Executor mainThreadExecutor)
-
-
Method Details
-
isChunkToRemove
protected abstract boolean isChunkToRemove(long node) -
getChunk
-
updateChunkScheduling
protected abstract @Nullable ChunkHolder updateChunkScheduling(long node, int level, @Nullable ChunkHolder chunk, int oldLevel) -
runAllUpdates
-
addPlayer
-
removePlayer
-
getPlayerTicketLevel
private int getPlayerTicketLevel() -
inEntityTickingRange
public boolean inEntityTickingRange(long key) -
inBlockTickingRange
public boolean inBlockTickingRange(long key) -
getChunkLevel
public int getChunkLevel(long key, boolean simulation) -
updatePlayerTickets
protected void updatePlayerTickets(int viewDistance) -
updateSimulationDistance
public void updateSimulationDistance(int newDistance) -
getNaturalSpawnChunkCount
public int getNaturalSpawnChunkCount() -
hasPlayersNearby
-
forEachEntityTickingChunk
public void forEachEntityTickingChunk(it.unimi.dsi.fastutil.longs.LongConsumer consumer) -
getSpawnCandidateChunks
public it.unimi.dsi.fastutil.longs.LongIterator getSpawnCandidateChunks() -
getDebugStatus
-
hasTickets
public boolean hasTickets()
-