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 pFirstQueuedLevel, int pWidth, int pHeight) -
Method Summary
Modifier and TypeMethodDescriptionprivate intcalculatePriority(int pOldLevel, int pNewLevel) protected voidcheckEdge(long pFromPos, long pToPos, int pNewLevel, boolean pIsDecreasing) private voidcheckEdge(long pFromPos, long pToPos, int pNewLevel, int pPreviousLevel, int pPropagationLevel, boolean pIsDecreasing) protected final voidcheckNeighbor(long pFromPos, long pToPos, int pSourceLevel, boolean pIsDecreasing) protected abstract voidcheckNeighborsAfterUpdate(long pPos, int pLevel, boolean pIsDecreasing) protected voidcheckNode(long pLevelPos) protected abstract intcomputeLevelFromNeighbor(long pStartPos, long pEndPos, int pStartLevel) Returns level propagated from start position with specified level to the neighboring end position.protected abstract intgetComputedLevel(long pPos, long pExcludedSourcePos, int pLevel) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position.protected abstract intgetLevel(long pChunkPos) intprotected final booleanhasWork()protected booleanisSource(long pPos) protected voidremoveFromQueue(long pPosition) voidremoveIf(LongPredicate pPredicate) protected final intrunUpdates(int pToUpdateCount) protected abstract voidsetLevel(long pChunkPos, int pLevel)
-
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 pFirstQueuedLevel, int pWidth, int pHeight)
-
-
Method Details
-
removeFromQueue
protected void removeFromQueue(long pPosition) -
removeIf
-
calculatePriority
private int calculatePriority(int pOldLevel, int pNewLevel) -
checkNode
protected void checkNode(long pLevelPos) -
checkEdge
protected void checkEdge(long pFromPos, long pToPos, int pNewLevel, boolean pIsDecreasing) -
checkEdge
private void checkEdge(long pFromPos, long pToPos, int pNewLevel, int pPreviousLevel, int pPropagationLevel, boolean pIsDecreasing) -
checkNeighbor
protected final void checkNeighbor(long pFromPos, long pToPos, int pSourceLevel, boolean pIsDecreasing) -
hasWork
protected final boolean hasWork() -
runUpdates
protected final int runUpdates(int pToUpdateCount) -
getQueueSize
public int getQueueSize() -
isSource
protected boolean isSource(long pPos) -
getComputedLevel
protected abstract int getComputedLevel(long pPos, long pExcludedSourcePos, int pLevel) Computes level propagated from neighbors of specified position with given existing level, excluding the given source position. -
checkNeighborsAfterUpdate
protected abstract void checkNeighborsAfterUpdate(long pPos, int pLevel, boolean pIsDecreasing) -
getLevel
protected abstract int getLevel(long pChunkPos) -
setLevel
protected abstract void setLevel(long pChunkPos, int pLevel) -
computeLevelFromNeighbor
protected abstract int computeLevelFromNeighbor(long pStartPos, long pEndPos, int pStartLevel) Returns level propagated from start position with specified level to the neighboring end position.
-