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[]
cachedChunkPositions
private BlockView[]
cachedChunks
protected ChunkProvider
chunkProvider
private static Direction[]
DIRECTIONS
private boolean
field_15794
protected S
lightStorage
protected BlockPos.Mutable
reusableBlockPos
protected LightType
type
-
Constructor Summary
Constructors Constructor Description ChunkLightProvider(ChunkProvider chunkProvider, LightType type, S lightStorage)
-
Method Summary
Modifier and Type Method Description void
addLightSource(BlockPos pos, int level)
void
checkBlock(BlockPos pos)
private void
clearChunkCache()
String
displaySectionLevel(long sectionPos)
int
doLightUpdates(int maxSteps, boolean doSkylight, boolean skipEdgeLightPropagation)
protected void
enqueueSectionData(long sectionPos, ChunkNibbleArray lightArray, boolean bool)
private BlockView
getChunk(int chunkX, int chunkZ)
protected int
getCurrentLevelFromSection(ChunkNibbleArray section, long blockPos)
protected int
getLevel(long id)
int
getLightLevel(BlockPos blockPos)
ChunkNibbleArray
getLightSection(ChunkSectionPos pos)
protected VoxelShape
getOpaqueShape(BlockState world, long pos, Direction facing)
protected int
getPropagatedLevel(long sourceId, long targetId, int level)
static int
getRealisticOpacity(BlockView world, BlockState state1, BlockPos pos1, BlockState state2, BlockPos pos2, Direction direction, int opacity2)
protected BlockState
getStateForLighting(long pos, MutableInt mutableInt)
boolean
hasUpdates()
protected boolean
isMarker(long id)
protected int
recalculateLevel(long id, long excludedId, int maxLevel)
protected void
resetLevel(long id)
void
setColumnEnabled(ChunkPos pos, boolean enabled)
protected void
setLevel(long id, int level)
void
setRetainColumn(ChunkPos pos, boolean retainData)
void
setSectionStatus(ChunkSectionPos pos, boolean notReady)
Methods inherited from class net.minecraft.world.chunk.light.LevelPropagator
applyPendingUpdates, getPendingUpdateCount, hasPendingUpdates, propagateLevel, propagateLevel, removePendingUpdate, removePendingUpdateIf, updateLevel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
resetLevel
in 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:
isMarker
in classLevelPropagator
-
recalculateLevel
protected int recalculateLevel(long id, long excludedId, int maxLevel)- Specified by:
recalculateLevel
in classLevelPropagator
-
getLevel
protected int getLevel(long id)- Specified by:
getLevel
in classLevelPropagator
-
getCurrentLevelFromSection
-
setLevel
protected void setLevel(long id, int level)- Specified by:
setLevel
in classLevelPropagator
-
getPropagatedLevel
protected int getPropagatedLevel(long sourceId, long targetId, int level)- Specified by:
getPropagatedLevel
in 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:
getLightSection
in interfaceChunkLightingView
-
getLightLevel
- Specified by:
getLightLevel
in interfaceChunkLightingView
-
displaySectionLevel
-
checkBlock
-
addLightSource
-
setSectionStatus
- Specified by:
setSectionStatus
in interfaceLightingView
-
setColumnEnabled
-
setRetainColumn
-