public abstract class ChunkTicketManager extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
ChunkTicketManager.DistanceFromNearestPlayerTracker |
(package private) class |
ChunkTicketManager.NearbyChunkTicketUpdater |
(package private) class |
ChunkTicketManager.TicketDistanceLevelPropagator |
Modifier and Type | Field and Description |
---|---|
private long |
age |
private Set<ChunkHolder> |
chunkHolders |
private it.unimi.dsi.fastutil.longs.LongSet |
chunkPositions |
private ChunkTicketManager.DistanceFromNearestPlayerTracker |
distanceFromNearestPlayerTracker |
private ChunkTicketManager.TicketDistanceLevelPropagator |
distanceFromTicketTracker |
private ChunkTaskPrioritySystem |
levelUpdateListener |
private static Logger |
LOGGER |
private Executor |
mainThreadExecutor |
private static int |
NEARBY_PLAYER_TICKET_LEVEL |
private ChunkTicketManager.NearbyChunkTicketUpdater |
nearbyChunkTicketUpdater |
private it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayerEntity>> |
playersByChunkPos |
private MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> |
playerTicketThrottler |
private MessageListener<ChunkTaskPrioritySystem.UnblockingMessage> |
playerTicketThrottlerUnblocker |
private it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<ChunkTicket<?>>> |
ticketsByPosition |
Modifier | Constructor and Description |
---|---|
protected |
ChunkTicketManager(Executor workerExecutor,
Executor mainThreadExecutor) |
Modifier and Type | Method and Description |
---|---|
<T> void |
addTicket(ChunkTicketType<T> type,
ChunkPos pos,
int radius,
T argument) |
private void |
addTicket(long position,
ChunkTicket<?> ticket) |
<T> void |
addTicketWithLevel(ChunkTicketType<T> type,
ChunkPos pos,
int level,
T argument) |
protected abstract ChunkHolder |
getChunkHolder(long pos) |
private static int |
getLevel(SortedArraySet<ChunkTicket<?>> sortedArraySet) |
int |
getSpawningChunkCount() |
protected String |
getTicket(long pos) |
private SortedArraySet<ChunkTicket<?>> |
getTicketSet(long position) |
void |
handleChunkEnter(ChunkSectionPos pos,
ServerPlayerEntity player) |
void |
handleChunkLeave(ChunkSectionPos pos,
ServerPlayerEntity player) |
protected abstract boolean |
isUnloaded(long pos) |
boolean |
method_20800(long long2) |
protected void |
purge() |
<T> void |
removeTicket(ChunkTicketType<T> type,
ChunkPos pos,
int radius,
T argument) |
private void |
removeTicket(long pos,
ChunkTicket<?> ticket) |
<T> void |
removeTicketWithLevel(ChunkTicketType<T> type,
ChunkPos pos,
int level,
T argument) |
protected void |
setChunkForced(ChunkPos pos,
boolean forced) |
protected abstract ChunkHolder |
setLevel(long pos,
int level,
ChunkHolder holder,
int int2) |
protected void |
setWatchDistance(int viewDistance) |
boolean |
tick(ThreadedAnvilChunkStorage chunkStorage) |
String |
toDumpString() |
private static final Logger LOGGER
private static final int NEARBY_PLAYER_TICKET_LEVEL
private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<it.unimi.dsi.fastutil.objects.ObjectSet<ServerPlayerEntity>> playersByChunkPos
private final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<SortedArraySet<ChunkTicket<?>>> ticketsByPosition
private final ChunkTicketManager.TicketDistanceLevelPropagator distanceFromTicketTracker
private final ChunkTicketManager.DistanceFromNearestPlayerTracker distanceFromNearestPlayerTracker
private final ChunkTicketManager.NearbyChunkTicketUpdater nearbyChunkTicketUpdater
private final Set<ChunkHolder> chunkHolders
private final ChunkTaskPrioritySystem levelUpdateListener
private final MessageListener<ChunkTaskPrioritySystem.Task<Runnable>> playerTicketThrottler
private final MessageListener<ChunkTaskPrioritySystem.UnblockingMessage> playerTicketThrottlerUnblocker
private final it.unimi.dsi.fastutil.longs.LongSet chunkPositions
private final Executor mainThreadExecutor
private long age
protected void purge()
private static int getLevel(SortedArraySet<ChunkTicket<?>> sortedArraySet)
protected abstract boolean isUnloaded(long pos)
@Nullable protected abstract ChunkHolder getChunkHolder(long pos)
@Nullable protected abstract ChunkHolder setLevel(long pos, int level, @Nullable ChunkHolder holder, int int2)
public boolean tick(ThreadedAnvilChunkStorage chunkStorage)
private void addTicket(long position, ChunkTicket<?> ticket)
private void removeTicket(long pos, ChunkTicket<?> ticket)
public <T> void addTicketWithLevel(ChunkTicketType<T> type, ChunkPos pos, int level, T argument)
public <T> void removeTicketWithLevel(ChunkTicketType<T> type, ChunkPos pos, int level, T argument)
public <T> void addTicket(ChunkTicketType<T> type, ChunkPos pos, int radius, T argument)
public <T> void removeTicket(ChunkTicketType<T> type, ChunkPos pos, int radius, T argument)
private SortedArraySet<ChunkTicket<?>> getTicketSet(long position)
protected void setChunkForced(ChunkPos pos, boolean forced)
public void handleChunkEnter(ChunkSectionPos pos, ServerPlayerEntity player)
public void handleChunkLeave(ChunkSectionPos pos, ServerPlayerEntity player)
protected String getTicket(long pos)
protected void setWatchDistance(int viewDistance)
public int getSpawningChunkCount()
public boolean method_20800(long long2)
public String toDumpString()