Class DynamicGraphMinFixedPoint
java.lang.Object
net.minecraft.world.level.lighting.DynamicGraphMinFixedPoint
- Direct Known Subclasses:
ChunkTracker
,SectionTracker
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.longs.Long2ByteMap
private boolean
protected final int
private static final int
private final LeveledPriorityQueue
static final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DynamicGraphMinFixedPoint
(int firstQueuedLevel, int width, int height) -
Method Summary
Modifier and TypeMethodDescriptionprivate int
calculatePriority
(int oldLevel, int newLevel) protected void
checkEdge
(long fromPos, long toPos, int newLevel, boolean isDecreasing) private void
checkEdge
(long fromPos, long toPos, int newLevel, int previousLevel, int propagationLevel, boolean isDecreasing) protected final void
checkNeighbor
(long fromPos, long toPos, int sourceLevel, boolean isDecreasing) protected abstract void
checkNeighborsAfterUpdate
(long pos, int level, boolean isDecreasing) protected void
checkNode
(long levelPos) protected abstract int
computeLevelFromNeighbor
(long startPos, long endPos, int startLevel) Returns level propagated from start position with specified level to the neighboring end position.protected abstract int
getComputedLevel
(long pos, long excludedSourcePos, int level) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position.protected abstract int
getLevel
(long chunkPos) int
protected final boolean
hasWork()
protected boolean
isSource
(long pos) protected void
removeFromQueue
(long position) void
removeIf
(LongPredicate predicate) protected final int
runUpdates
(int toUpdateCount) protected abstract void
setLevel
(long chunkPos, int level)
-
Field Details
-
SOURCE
public static final long SOURCE- See Also:
-
NO_COMPUTED_LEVEL
private static final int NO_COMPUTED_LEVEL- See Also:
-
levelCount
protected final int levelCount -
priorityQueue
-
computedLevels
private final it.unimi.dsi.fastutil.longs.Long2ByteMap computedLevels -
hasWork
private volatile boolean hasWork
-
-
Constructor Details
-
DynamicGraphMinFixedPoint
protected DynamicGraphMinFixedPoint(int firstQueuedLevel, int width, int height)
-
-
Method Details
-
removeFromQueue
protected void removeFromQueue(long position) -
removeIf
-
calculatePriority
private int calculatePriority(int oldLevel, int newLevel) -
checkNode
protected void checkNode(long levelPos) -
checkEdge
protected void checkEdge(long fromPos, long toPos, int newLevel, boolean isDecreasing) -
checkEdge
private void checkEdge(long fromPos, long toPos, int newLevel, int previousLevel, int propagationLevel, boolean isDecreasing) -
checkNeighbor
protected final void checkNeighbor(long fromPos, long toPos, int sourceLevel, boolean isDecreasing) -
hasWork
protected final boolean hasWork() -
runUpdates
protected final int runUpdates(int toUpdateCount) -
getQueueSize
public int getQueueSize() -
isSource
protected boolean isSource(long pos) -
getComputedLevel
protected abstract int getComputedLevel(long pos, long excludedSourcePos, int level) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position. -
checkNeighborsAfterUpdate
protected abstract void checkNeighborsAfterUpdate(long pos, int level, boolean isDecreasing) -
getLevel
protected abstract int getLevel(long chunkPos) -
setLevel
protected abstract void setLevel(long chunkPos, int level) -
computeLevelFromNeighbor
protected abstract int computeLevelFromNeighbor(long startPos, long endPos, int startLevel) Returns level propagated from start position with specified level to the neighboring end position.
-