Class ChunkTracker
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.player.ChunkTracker
- All Implemented Interfaces:
Component<EntityStore>,Cloneable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate intprivate intprivate floatprivate intprivate intprivate final HLongSetprivate final StampedLockprivate final HLongSetstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intprivate intprivate intprivate intstatic final MetricsRegistry<ChunkTracker> static final intprivate intprivate booleanprivate final HLongSetprivate intprivate final CircleSpiralIteratorprivate TransformComponentFields inherited from interface com.hypixel.hytale.component.Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate CompletableFuture<Void> _loadChunkAsync(long chunkIndex, PlayerRef playerRefComponent, Ref<ChunkStore> chunkRef, ChunkStore chunkStore) voidclear()clone()voidcopyFrom(ChunkTracker chunkTracker) getChunkVisibility(long indexChunk) static ComponentType<EntityStore, ChunkTracker> intprivate StringintintintintintbooleanisLoaded(long indexChunk) booleanvoidremoveForReload(long indexChunk) voidsetDefaultMaxChunksPerSecond(PlayerRef playerRef) voidsetMaxChunksPerSecond(int maxChunksPerSecond) voidsetMaxChunksPerTick(int maxChunksPerTick) voidsetMaxHotLoadedChunksRadius(int maxHotLoadedChunksRadius) voidsetMinLoadedChunksRadius(int minLoadedChunksRadius) voidsetReadyForChunks(boolean readyForChunks) private static booleanshouldBeVisible(int chunkViewRadiusSquared, int chunkX, int chunkZ, int x, int z) booleanshouldBeVisible(long chunkCoordinates) voidtick(Ref<EntityStore> playerRef, float dt, CommandBuffer<EntityStore> commandBuffer) voidtryLoadChunkAsync(ChunkStore chunkStore, PlayerRef playerRefComponent, long chunkIndex, TransformComponent transformComponent, ComponentAccessor<EntityStore> componentAccessor) static booleantryUnloadChunk(long chunkIndex, int chunkViewRadiusSquared, int chunkX, int chunkZ, PlayerRef playerRef, it.unimi.dsi.fastutil.longs.LongSet loading) voidMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.component.Component
cloneSerializable
-
Field Details
-
METRICS_REGISTRY
-
MAX_CHUNKS_PER_SECOND_LOCAL
public static final int MAX_CHUNKS_PER_SECOND_LOCAL- See Also:
-
MAX_CHUNKS_PER_SECOND_LAN
public static final int MAX_CHUNKS_PER_SECOND_LAN- See Also:
-
MAX_CHUNKS_PER_SECOND
public static final int MAX_CHUNKS_PER_SECOND- See Also:
-
MAX_CHUNKS_PER_TICK
public static final int MAX_CHUNKS_PER_TICK- See Also:
-
MIN_LOADED_CHUNKS_RADIUS
public static final int MIN_LOADED_CHUNKS_RADIUS- See Also:
-
MAX_HOT_LOADED_CHUNKS_RADIUS
public static final int MAX_HOT_LOADED_CHUNKS_RADIUS- See Also:
-
MAX_FAILURE_BACKOFF_NANOS
public static final long MAX_FAILURE_BACKOFF_NANOS -
transformComponent
-
chunkViewRadius
private int chunkViewRadius -
spiralIterator
-
loadedLock
-
loading
-
loaded
-
reload
-
maxChunksPerSecond
private int maxChunksPerSecond -
inverseMaxChunksPerSecond
private float inverseMaxChunksPerSecond -
maxChunksPerTick
private int maxChunksPerTick -
minLoadedChunksRadius
private int minLoadedChunksRadius -
maxHotLoadedChunksRadius
private int maxHotLoadedChunksRadius -
accumulator
private float accumulator -
sentViewRadius
private int sentViewRadius -
hotRadius
private int hotRadius -
lastChunkX
private int lastChunkX -
lastChunkZ
private int lastChunkZ -
readyForChunks
private boolean readyForChunks
-
-
Constructor Details
-
ChunkTracker
public ChunkTracker() -
ChunkTracker
-
-
Method Details
-
getComponentType
-
unloadAll
-
clear
public void clear() -
tick
public void tick(@Nonnull Ref<EntityStore> playerRef, float dt, @Nonnull CommandBuffer<EntityStore> commandBuffer) -
isLoaded
public boolean isLoaded(long indexChunk) -
removeForReload
public void removeForReload(long indexChunk) -
shouldBeVisible
public boolean shouldBeVisible(long chunkCoordinates) -
getChunkVisibility
-
getMaxChunksPerSecond
public int getMaxChunksPerSecond() -
setMaxChunksPerSecond
public void setMaxChunksPerSecond(int maxChunksPerSecond) -
setDefaultMaxChunksPerSecond
-
getMaxChunksPerTick
public int getMaxChunksPerTick() -
setMaxChunksPerTick
public void setMaxChunksPerTick(int maxChunksPerTick) -
getMinLoadedChunksRadius
public int getMinLoadedChunksRadius() -
setMinLoadedChunksRadius
public void setMinLoadedChunksRadius(int minLoadedChunksRadius) -
getMaxHotLoadedChunksRadius
public int getMaxHotLoadedChunksRadius() -
setMaxHotLoadedChunksRadius
public void setMaxHotLoadedChunksRadius(int maxHotLoadedChunksRadius) -
getLoadedChunksCount
public int getLoadedChunksCount() -
getLoadingChunksCount
public int getLoadingChunksCount() -
getLoadedChunksGrid
-
getLoadedChunksMessage
-
getLoadedChunksDebug
-
setReadyForChunks
public void setReadyForChunks(boolean readyForChunks) -
isReadyForChunks
public boolean isReadyForChunks() -
copyFrom
-
clone
- Specified by:
clonein interfaceComponent<EntityStore>- Overrides:
clonein classObject
-
shouldBeVisible
private static boolean shouldBeVisible(int chunkViewRadiusSquared, int chunkX, int chunkZ, int x, int z) -
tryUnloadChunk
public static boolean tryUnloadChunk(long chunkIndex, int chunkViewRadiusSquared, int chunkX, int chunkZ, @Nonnull PlayerRef playerRef, @Nonnull it.unimi.dsi.fastutil.longs.LongSet loading) -
tryLoadChunkAsync
public void tryLoadChunkAsync(@Nonnull ChunkStore chunkStore, @Nonnull PlayerRef playerRefComponent, long chunkIndex, @Nonnull TransformComponent transformComponent, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
_loadChunkAsync
@Nonnull private CompletableFuture<Void> _loadChunkAsync(long chunkIndex, @Nonnull PlayerRef playerRefComponent, @Nonnull Ref<ChunkStore> chunkRef, @Nonnull ChunkStore chunkStore)
-