Package net.minecraft.world.server
Class TicketManager
- java.lang.Object
-
- net.minecraft.world.server.TicketManager
-
- Direct Known Subclasses:
ChunkManager.ProxyTicketManager
public abstract class TicketManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
TicketManager.ChunkTicketTracker
(package private) class
TicketManager.PlayerChunkTracker
(package private) class
TicketManager.PlayerTicketTracker
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
TicketManager(java.util.concurrent.Executor p_i50707_1_, java.util.concurrent.Executor p_i50707_2_)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
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
addTicket(long p_219347_1_, Ticket<?> p_219347_3_)
<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_)
java.lang.String
getDebugStatus()
int
getNaturalSpawnChunkCount()
protected java.lang.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
purgeStaleTickets()
<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 Detail
-
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
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> tickets
-
ticketTracker
private final TicketManager.ChunkTicketTracker ticketTracker
-
naturalSpawnChunkCounter
private final TicketManager.PlayerChunkTracker naturalSpawnChunkCounter
-
playerTicketManager
private final TicketManager.PlayerTicketTracker playerTicketManager
-
chunksToUpdateFutures
private final java.util.Set<ChunkHolder> chunksToUpdateFutures
-
ticketThrottler
private final ChunkTaskPriorityQueueSorter ticketThrottler
-
ticketThrottlerInput
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.FunctionEntry<java.lang.Runnable>> ticketThrottlerInput
-
ticketThrottlerReleaser
private final ITaskExecutor<ChunkTaskPriorityQueueSorter.RunnableEntry> ticketThrottlerReleaser
-
ticketsToRelease
private final it.unimi.dsi.fastutil.longs.LongSet ticketsToRelease
-
mainThreadExecutor
private final java.util.concurrent.Executor mainThreadExecutor
-
ticketTickCounter
private long ticketTickCounter
-
forcedTickets
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<Ticket<?>>> forcedTickets
-
-
Method Detail
-
purgeStaleTickets
protected void purgeStaleTickets()
-
getTicketLevelAt
private static int getTicketLevelAt(SortedArraySet<Ticket<?>> p_229844_0_)
-
isChunkToRemove
protected abstract boolean isChunkToRemove(long p_219371_1_)
-
getChunk
@Nullable protected abstract ChunkHolder getChunk(long p_219335_1_)
-
updateChunkScheduling
@Nullable protected abstract ChunkHolder updateChunkScheduling(long p_219372_1_, int p_219372_3_, @Nullable ChunkHolder p_219372_4_, int p_219372_5_)
-
runAllUpdates
public boolean runAllUpdates(ChunkManager p_219353_1_)
-
addTicket
private void addTicket(long p_219347_1_, Ticket<?> p_219347_3_)
-
removeTicket
private void removeTicket(long p_219349_1_, Ticket<?> p_219349_3_)
-
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
public <T> void registerTicking(TicketType<T> type, ChunkPos pos, int distance, T value)
-
releaseTicking
public <T> void releaseTicking(TicketType<T> type, ChunkPos pos, int distance, T value)
-
getTickets
private SortedArraySet<Ticket<?>> getTickets(long p_229848_1_)
-
updateChunkForced
protected void updateChunkForced(ChunkPos p_219364_1_, boolean p_219364_2_)
-
addPlayer
public void addPlayer(SectionPos p_219341_1_, ServerPlayerEntity p_219341_2_)
-
removePlayer
public void removePlayer(SectionPos p_219367_1_, ServerPlayerEntity p_219367_2_)
-
getTicketDebugString
protected java.lang.String getTicketDebugString(long p_225413_1_)
-
updatePlayerTickets
protected void updatePlayerTickets(int p_219354_1_)
-
getNaturalSpawnChunkCount
public int getNaturalSpawnChunkCount()
-
hasPlayersNearby
public boolean hasPlayersNearby(long p_223494_1_)
-
getDebugStatus
public java.lang.String getDebugStatus()
-
shouldForceTicks
public boolean shouldForceTicks(long chunkPos)
-
-