Package net.minecraft.world.server
Class TicketManager
java.lang.Object
net.minecraft.world.server.TicketManager
- Direct Known Subclasses:
ChunkManager.ProxyTicketManager
-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
(package private) class
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Set<ChunkHolder>
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>>
private static final org.apache.logging.log4j.Logger
private final Executor
private final TicketManager.PlayerChunkTracker
private static final int
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayerEntity>>
private final TicketManager.PlayerTicketTracker
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>>
private final it.unimi.dsi.fastutil.longs.LongSet
private final ChunkTaskPriorityQueueSorter
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.FunctionEntry<Runnable>>
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.RunnableEntry>
private long
private final TicketManager.ChunkTicketTracker
-
Constructor Summary
ModifierConstructorDescriptionprotected
TicketManager
(Executor p_i50707_1_, Executor p_i50707_2_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlayer
(SectionPos p_219341_1_, ServerPlayerEntity p_219341_2_) <T> void
addRegionTicket
(TicketType<T> p_219331_1_, ChunkPos p_219331_2_, int p_219331_3_, T p_219331_4_) private void
<T> void
addTicket
(TicketType<T> p_219356_1_, ChunkPos p_219356_2_, int p_219356_3_, T p_219356_4_) protected abstract ChunkHolder
getChunk
(long p_219335_1_) int
protected String
getTicketDebugString
(long p_225413_1_) private static int
getTicketLevelAt
(SortedArraySet<Ticket<?>> p_229844_0_) private SortedArraySet<Ticket<?>>
getTickets
(long p_229848_1_) boolean
hasPlayersNearby
(long p_223494_1_) protected abstract boolean
isChunkToRemove
(long p_219371_1_) protected void
<T> void
registerTicking
(TicketType<T> type, ChunkPos pos, int distance, T value) <T> void
releaseTicking
(TicketType<T> type, ChunkPos pos, int distance, T value) void
removePlayer
(SectionPos p_219367_1_, ServerPlayerEntity p_219367_2_) <T> void
removeRegionTicket
(TicketType<T> p_219362_1_, ChunkPos p_219362_2_, int p_219362_3_, T p_219362_4_) private void
removeTicket
(long p_219349_1_, Ticket<?> p_219349_3_) <T> void
removeTicket
(TicketType<T> p_219345_1_, ChunkPos p_219345_2_, int p_219345_3_, T p_219345_4_) boolean
runAllUpdates
(ChunkManager p_219353_1_) boolean
shouldForceTicks
(long chunkPos) protected void
updateChunkForced
(ChunkPos p_219364_1_, boolean p_219364_2_) protected abstract ChunkHolder
updateChunkScheduling
(long p_219372_1_, int p_219372_3_, ChunkHolder p_219372_4_, int p_219372_5_) protected void
updatePlayerTickets
(int p_219354_1_)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.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<ServerPlayerEntity>> playersPerChunk -
tickets
-
ticketTracker
-
naturalSpawnChunkCounter
-
playerTicketManager
-
chunksToUpdateFutures
-
ticketThrottler
-
ticketThrottlerInput
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.FunctionEntry<Runnable>> ticketThrottlerInput -
ticketThrottlerReleaser
-
ticketsToRelease
private final it.unimi.dsi.fastutil.longs.LongSet ticketsToRelease -
mainThreadExecutor
-
ticketTickCounter
private long ticketTickCounter -
forcedTickets
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> forcedTickets
-
-
Constructor Details
-
TicketManager
-
-
Method Details
-
purgeStaleTickets
protected void purgeStaleTickets() -
getTicketLevelAt
-
isChunkToRemove
protected abstract boolean isChunkToRemove(long p_219371_1_) -
getChunk
-
updateChunkScheduling
@Nullable protected abstract ChunkHolder updateChunkScheduling(long p_219372_1_, int p_219372_3_, @Nullable ChunkHolder p_219372_4_, int p_219372_5_) -
runAllUpdates
-
addTicket
-
removeTicket
-
addTicket
public <T> void addTicket(TicketType<T> p_219356_1_, ChunkPos p_219356_2_, int p_219356_3_, T p_219356_4_) -
removeTicket
public <T> void removeTicket(TicketType<T> p_219345_1_, ChunkPos p_219345_2_, int p_219345_3_, T p_219345_4_) -
addRegionTicket
public <T> void addRegionTicket(TicketType<T> p_219331_1_, ChunkPos p_219331_2_, int p_219331_3_, T p_219331_4_) -
removeRegionTicket
public <T> void removeRegionTicket(TicketType<T> p_219362_1_, ChunkPos p_219362_2_, int p_219362_3_, T p_219362_4_) -
registerTicking
-
releaseTicking
-
getTickets
-
updateChunkForced
-
addPlayer
-
removePlayer
-
getTicketDebugString
-
updatePlayerTickets
protected void updatePlayerTickets(int p_219354_1_) -
getNaturalSpawnChunkCount
public int getNaturalSpawnChunkCount() -
hasPlayersNearby
public boolean hasPlayersNearby(long p_223494_1_) -
getDebugStatus
-
shouldForceTicks
public boolean shouldForceTicks(long chunkPos)
-