public abstract class ChunkLightProvider<M extends ChunkToNibbleArrayMap<M>,S extends LightStorage<M>> extends LevelPropagator implements ChunkLightingView
ChunkLightingView.Empty
Modifier and Type | Field and 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 and Description |
---|
ChunkLightProvider(ChunkProvider chunkProvider,
LightType type,
S lightStorage) |
Modifier and Type | Method and 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) |
applyPendingUpdates, getPendingUpdateCount, hasPendingUpdates, propagateLevel, propagateLevel, removePendingUpdate, removePendingUpdateIf, updateLevel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setSectionStatus
private static final Direction[] DIRECTIONS
protected final ChunkProvider chunkProvider
protected final LightType type
protected final S extends LightStorage<M> lightStorage
private boolean field_15794
protected final BlockPos.Mutable reusableBlockPos
private final long[] cachedChunkPositions
private final BlockView[] cachedChunks
public ChunkLightProvider(ChunkProvider chunkProvider, LightType type, S lightStorage)
protected void resetLevel(long id)
resetLevel
in class LevelPropagator
private void clearChunkCache()
protected BlockState getStateForLighting(long pos, @Nullable MutableInt mutableInt)
protected VoxelShape getOpaqueShape(BlockState world, long pos, Direction facing)
public static int getRealisticOpacity(BlockView world, BlockState state1, BlockPos pos1, BlockState state2, BlockPos pos2, Direction direction, int opacity2)
protected boolean isMarker(long id)
isMarker
in class LevelPropagator
protected int recalculateLevel(long id, long excludedId, int maxLevel)
recalculateLevel
in class LevelPropagator
protected int getLevel(long id)
getLevel
in class LevelPropagator
protected int getCurrentLevelFromSection(ChunkNibbleArray section, long blockPos)
protected void setLevel(long id, int level)
setLevel
in class LevelPropagator
protected int getPropagatedLevel(long sourceId, long targetId, int level)
getPropagatedLevel
in class LevelPropagator
public boolean hasUpdates()
public int doLightUpdates(int maxSteps, boolean doSkylight, boolean skipEdgeLightPropagation)
protected void enqueueSectionData(long sectionPos, @Nullable ChunkNibbleArray lightArray, boolean bool)
@Nullable public ChunkNibbleArray getLightSection(ChunkSectionPos pos)
getLightSection
in interface ChunkLightingView
public int getLightLevel(BlockPos blockPos)
getLightLevel
in interface ChunkLightingView
@Environment(value=CLIENT) public String displaySectionLevel(long sectionPos)
public void checkBlock(BlockPos pos)
public void addLightSource(BlockPos pos, int level)
public void setSectionStatus(ChunkSectionPos pos, boolean notReady)
setSectionStatus
in interface LightingView
public void setColumnEnabled(ChunkPos pos, boolean enabled)
public void setRetainColumn(ChunkPos pos, boolean retainData)