Package net.minecraft.server.level
Class DistanceManager
java.lang.Object
net.minecraft.server.level.DistanceManager
- Direct Known Subclasses:
ChunkMap.DistanceManager
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) class
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
(package private) final Set<ChunkHolder>
private static final int
private static final int
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>>
private static final int
(package private) static final org.slf4j.Logger
(package private) final Executor
private final DistanceManager.FixedPlayerDistanceChunkTracker
(package private) static final int
(package private) final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayer>>
private final DistanceManager.PlayerTicketTracker
private int
(package private) final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>>
(package private) final it.unimi.dsi.fastutil.longs.LongSet
(package private) final ChunkTaskPriorityQueueSorter
(package private) final ProcessorHandle<ChunkTaskPriorityQueueSorter.Message<Runnable>>
(package private) final ProcessorHandle<ChunkTaskPriorityQueueSorter.Release>
private long
private final DistanceManager.ChunkTicketTracker
private final TickingTracker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlayer
(SectionPos p_140803_, ServerPlayer p_140804_) <T> void
addRegionTicket
(TicketType<T> p_140841_, ChunkPos p_140842_, int p_140843_, T p_140844_) <T> void
addRegionTicket
(TicketType<T> p_140841_, ChunkPos p_140842_, int p_140843_, T p_140844_, boolean forceTicks) (package private) void
<T> void
addTicket
(TicketType<T> p_140793_, ChunkPos p_140794_, int p_140795_, T p_140796_) private void
dumpTickets
(String p_143208_) protected abstract ChunkHolder
getChunk
(long p_140817_) int
private int
protected String
getTicketDebugString
(long p_140839_) private static int
getTicketLevelAt
(SortedArraySet<Ticket<?>> p_140798_) private SortedArraySet<Ticket<?>>
getTickets
(long p_140858_) boolean
hasPlayersNearby
(long p_140848_) boolean
boolean
inBlockTickingRange
(long p_183917_) boolean
inEntityTickingRange
(long p_183914_) protected abstract boolean
isChunkToRemove
(long p_140779_) protected void
<T> void
registerTicking
(TicketType<T> type, ChunkPos pos, int distance, T value) Deprecated, for removal: This API element is subject to removal in a future version.<T> void
releaseTicking
(TicketType<T> type, ChunkPos pos, int distance, T value) Deprecated, for removal: This API element is subject to removal in a future version.void
removePlayer
(SectionPos p_140829_, ServerPlayer p_140830_) <T> void
removeRegionTicket
(TicketType<T> p_140850_, ChunkPos p_140851_, int p_140852_, T p_140853_) <T> void
removeRegionTicket
(TicketType<T> p_140850_, ChunkPos p_140851_, int p_140852_, T p_140853_, boolean forceTicks) (package private) void
removeTicket
(long p_140819_, Ticket<?> p_140820_) <T> void
removeTicket
(TicketType<T> p_140824_, ChunkPos p_140825_, int p_140826_, T p_140827_) void
boolean
runAllUpdates
(ChunkMap p_140806_) boolean
shouldForceTicks
(long chunkPos) (package private) TickingTracker
protected void
updateChunkForced
(ChunkPos p_140800_, boolean p_140801_) protected abstract ChunkHolder
updateChunkScheduling
(long p_140780_, int p_140781_, ChunkHolder p_140782_, int p_140783_) protected void
updatePlayerTickets
(int p_140778_) void
updateSimulationDistance
(int p_183912_)
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
ENTITY_TICKING_RANGE
private static final int ENTITY_TICKING_RANGE- See Also:
-
PLAYER_TICKET_LEVEL
static final int PLAYER_TICKET_LEVEL -
INITIAL_TICKET_LIST_CAPACITY
private static final int INITIAL_TICKET_LIST_CAPACITY- See Also:
-
ENTITY_TICKING_LEVEL_THRESHOLD
private static final int ENTITY_TICKING_LEVEL_THRESHOLD- See Also:
-
BLOCK_TICKING_LEVEL_THRESHOLD
private static final int BLOCK_TICKING_LEVEL_THRESHOLD- See Also:
-
playersPerChunk
final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayer>> playersPerChunk -
tickets
-
ticketTracker
-
naturalSpawnChunkCounter
-
tickingTicketsTracker
-
playerTicketManager
-
chunksToUpdateFutures
-
ticketThrottler
-
ticketThrottlerInput
-
ticketThrottlerReleaser
-
ticketsToRelease
final it.unimi.dsi.fastutil.longs.LongSet ticketsToRelease -
mainThreadExecutor
-
ticketTickCounter
private long ticketTickCounter -
simulationDistance
private int simulationDistance -
forcedTickets
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> forcedTickets
-
-
Constructor Details
-
DistanceManager
-
-
Method Details
-
purgeStaleTickets
protected void purgeStaleTickets() -
getTicketLevelAt
-
isChunkToRemove
protected abstract boolean isChunkToRemove(long p_140779_) -
getChunk
-
updateChunkScheduling
@Nullable protected abstract ChunkHolder updateChunkScheduling(long p_140780_, int p_140781_, @Nullable ChunkHolder p_140782_, int p_140783_) -
runAllUpdates
-
addTicket
-
removeTicket
-
addTicket
-
removeTicket
public <T> void removeTicket(TicketType<T> p_140824_, ChunkPos p_140825_, int p_140826_, T p_140827_) -
addRegionTicket
public <T> void addRegionTicket(TicketType<T> p_140841_, ChunkPos p_140842_, int p_140843_, T p_140844_) -
addRegionTicket
public <T> void addRegionTicket(TicketType<T> p_140841_, ChunkPos p_140842_, int p_140843_, T p_140844_, boolean forceTicks) -
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> p_140850_, ChunkPos p_140851_, int p_140852_, T p_140853_) -
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> p_140850_, ChunkPos p_140851_, int p_140852_, T p_140853_, boolean forceTicks) -
registerTicking
@Deprecated(forRemoval=true, since="1.18.2") public <T> void registerTicking(TicketType<T> type, ChunkPos pos, int distance, T value) Deprecated, for removal: This API element is subject to removal in a future version. -
releaseTicking
@Deprecated(forRemoval=true, since="1.18.2") public <T> void releaseTicking(TicketType<T> type, ChunkPos pos, int distance, T value) Deprecated, for removal: This API element is subject to removal in a future version. -
getTickets
-
updateChunkForced
-
addPlayer
-
removePlayer
-
getPlayerTicketLevel
private int getPlayerTicketLevel() -
inEntityTickingRange
public boolean inEntityTickingRange(long p_183914_) -
inBlockTickingRange
public boolean inBlockTickingRange(long p_183917_) -
getTicketDebugString
-
updatePlayerTickets
protected void updatePlayerTickets(int p_140778_) -
updateSimulationDistance
public void updateSimulationDistance(int p_183912_) -
getNaturalSpawnChunkCount
public int getNaturalSpawnChunkCount() -
hasPlayersNearby
public boolean hasPlayersNearby(long p_140848_) -
getDebugStatus
-
shouldForceTicks
public boolean shouldForceTicks(long chunkPos) -
dumpTickets
-
tickingTracker
TickingTracker tickingTracker() -
removeTicketsOnClosing
public void removeTicketsOnClosing() -
hasTickets
public boolean hasTickets()
-