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()intdoLightUpdates(int maxSteps, boolean doSkylight, boolean skipEdgeLightPropagation)private BlockViewgetChunk(int chunkX, int chunkZ)protected intgetCurrentLevelFromArray(ChunkNibbleArray array, long blockPos)protected intgetLevel(long id)ChunkNibbleArraygetLightArray(ChunkSectionPos pos)intgetLightLevel(BlockPos blockPos)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)Stringmethod_22875(long long2)protected intrecalculateLevel(long id, long excludedId, int maxLevel)protected voidresetLevel(long id)protected voidsetLevel(long id, int level)protected voidsetLightArray(long pos, ChunkNibbleArray lightArray, boolean bool)voidsetLightEnabled(ChunkPos pos, boolean lightEnabled)voidsetRetainData(ChunkPos pos, boolean retainData)voidupdateSectionStatus(ChunkSectionPos pos, boolean status)Methods inherited from class net.minecraft.world.chunk.light.LevelPropagator
applyPendingUpdates, hasPendingUpdates, method_24206, method_24208, propagateLevel, propagateLevel, removePendingUpdate, updateLevel
-
Field Details
-
DIRECTIONS
-
chunkProvider
-
type
-
lightStorage
-
field_15794
private boolean field_15794 -
reusableBlockPos
-
cachedChunkPositions
private final long[] cachedChunkPositions -
cachedChunks
-
-
Constructor Details
-
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
-
getCurrentLevelFromArray
-
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) -
setLightArray
-
getLightArray
- Specified by:
getLightArrayin interfaceChunkLightingView
-
getLightLevel
- Specified by:
getLightLevelin interfaceChunkLightingView
-
method_22875
-
checkBlock
-
addLightSource
-
updateSectionStatus
- Specified by:
updateSectionStatusin interfaceLightingView
-
setLightEnabled
-
setRetainData
-