Package net.minecraft.world.chunk.light
Class ChunkLightProvider<M extends ChunkToNibbleArrayMap<M>,S extends LightStorage<M>>
java.lang.Object
net.minecraft.world.chunk.light.LevelPropagator
net.minecraft.world.chunk.light.ChunkLightProvider<M,S>
- All Implemented Interfaces:
ChunkLightingView,LightingView
- Direct Known Subclasses:
ChunkBlockLightProvider,ChunkSkyLightProvider
public abstract class ChunkLightProvider<M extends ChunkToNibbleArrayMap<M>,S extends LightStorage<M>> extends LevelPropagator implements ChunkLightingView
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.chunk.light.ChunkLightingView
ChunkLightingView.Empty -
Field Summary
Fields Modifier and Type Field Description private long[]cachedChunkPositionsprivate BlockView[]cachedChunksprotected ChunkProviderchunkProviderprivate static Direction[]DIRECTIONSprivate booleanfield_15794protected SlightStorageprotected BlockPos.MutablereusableBlockPosprotected LightTypetype -
Constructor Summary
Constructors Constructor Description ChunkLightProvider(ChunkProvider chunkProvider, LightType type, S lightStorage) -
Method Summary
Modifier and Type Method Description voidaddLightSource(BlockPos pos, int level)voidcheckBlock(BlockPos pos)private voidclearChunkCache()StringdisplaySectionLevel(long sectionPos)intdoLightUpdates(int maxSteps, boolean doSkylight, boolean skipEdgeLightPropagation)protected voidenqueueSectionData(long sectionPos, ChunkNibbleArray lightArray, boolean bool)private BlockViewgetChunk(int chunkX, int chunkZ)protected intgetCurrentLevelFromSection(ChunkNibbleArray section, long blockPos)protected intgetLevel(long id)intgetLightLevel(BlockPos blockPos)ChunkNibbleArraygetLightSection(ChunkSectionPos pos)protected VoxelShapegetOpaqueShape(BlockState world, long pos, Direction facing)protected intgetPropagatedLevel(long sourceId, long targetId, int level)static intgetRealisticOpacity(BlockView world, BlockState state1, BlockPos pos1, BlockState state2, BlockPos pos2, Direction direction, int opacity2)protected BlockStategetStateForLighting(long pos, MutableInt mutableInt)booleanhasUpdates()protected booleanisMarker(long id)protected intrecalculateLevel(long id, long excludedId, int maxLevel)protected voidresetLevel(long id)voidsetColumnEnabled(ChunkPos pos, boolean enabled)protected voidsetLevel(long id, int level)voidsetRetainColumn(ChunkPos pos, boolean retainData)voidsetSectionStatus(ChunkSectionPos pos, boolean notReady)Methods inherited from class net.minecraft.world.chunk.light.LevelPropagator
applyPendingUpdates, getPendingUpdateCount, hasPendingUpdates, propagateLevel, propagateLevel, removePendingUpdate, removePendingUpdateIf, updateLevelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.chunk.light.LightingView
setSectionStatus
-
Field Details
-
DIRECTIONS
-
chunkProvider
-
type
-
lightStorage
-
field_15794
private boolean field_15794 -
reusableBlockPos
-
cachedChunkPositions
private final long[] cachedChunkPositions -
cachedChunks
-
-
Constructor Details
-
ChunkLightProvider
-
-
Method Details
-
resetLevel
protected void resetLevel(long id)- Overrides:
resetLevelin classLevelPropagator
-
getChunk
-
clearChunkCache
private void clearChunkCache() -
getStateForLighting
-
getOpaqueShape
-
getRealisticOpacity
public static int getRealisticOpacity(BlockView world, BlockState state1, BlockPos pos1, BlockState state2, BlockPos pos2, Direction direction, int opacity2) -
isMarker
protected boolean isMarker(long id)- Specified by:
isMarkerin classLevelPropagator
-
recalculateLevel
protected int recalculateLevel(long id, long excludedId, int maxLevel)- Specified by:
recalculateLevelin classLevelPropagator
-
getLevel
protected int getLevel(long id)- Specified by:
getLevelin classLevelPropagator
-
getCurrentLevelFromSection
-
setLevel
protected void setLevel(long id, int level)- Specified by:
setLevelin classLevelPropagator
-
getPropagatedLevel
protected int getPropagatedLevel(long sourceId, long targetId, int level)- Specified by:
getPropagatedLevelin classLevelPropagator
-
hasUpdates
public boolean hasUpdates() -
doLightUpdates
public int doLightUpdates(int maxSteps, boolean doSkylight, boolean skipEdgeLightPropagation) -
enqueueSectionData
protected void enqueueSectionData(long sectionPos, @Nullable ChunkNibbleArray lightArray, boolean bool) -
getLightSection
- Specified by:
getLightSectionin interfaceChunkLightingView
-
getLightLevel
- Specified by:
getLightLevelin interfaceChunkLightingView
-
displaySectionLevel
-
checkBlock
-
addLightSource
-
setSectionStatus
- Specified by:
setSectionStatusin interfaceLightingView
-
setColumnEnabled
-
setRetainColumn
-