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.Long2ByteMapprivate booleanprotected final intprivate static final intprivate final LeveledPriorityQueuestatic final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDynamicGraphMinFixedPoint(int firstQueuedLevel, int width, int height) -
Method Summary
Modifier and TypeMethodDescriptionprivate intcalculatePriority(int oldLevel, int newLevel) protected voidcheckEdge(long fromPos, long toPos, int newLevel, boolean isDecreasing) private voidcheckEdge(long fromPos, long toPos, int newLevel, int previousLevel, int propagationLevel, boolean isDecreasing) protected final voidcheckNeighbor(long fromPos, long toPos, int sourceLevel, boolean isDecreasing) protected abstract voidcheckNeighborsAfterUpdate(long pos, int level, boolean isDecreasing) protected voidcheckNode(long levelPos) protected abstract intcomputeLevelFromNeighbor(long startPos, long endPos, int startLevel) Returns level propagated from start position with specified level to the neighboring end position.protected abstract intgetComputedLevel(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 intgetLevel(long chunkPos) intprotected final booleanhasWork()protected booleanisSource(long pos) protected voidremoveFromQueue(long position) voidremoveIf(LongPredicate predicate) protected final intrunUpdates(int toUpdateCount) protected abstract voidsetLevel(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.
-