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() |
int |
doLightUpdates(int maxSteps,
boolean doSkylight,
boolean skipEdgeLightPropagation) |
private BlockView |
getChunk(int chunkX,
int chunkZ) |
protected int |
getCurrentLevelFromArray(ChunkNibbleArray array,
long blockPos) |
protected int |
getLevel(long id) |
ChunkNibbleArray |
getLightArray(ChunkSectionPos pos) |
int |
getLightLevel(BlockPos blockPos) |
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) |
String |
method_22875(long long2) |
protected int |
recalculateLevel(long id,
long excludedId,
int maxLevel) |
protected void |
resetLevel(long id) |
protected void |
setLevel(long id,
int level) |
protected void |
setLightArray(long pos,
ChunkNibbleArray lightArray) |
void |
setLightEnabled(ChunkPos pos,
boolean lightEnabled) |
void |
setRetainData(ChunkPos pos,
boolean retainData) |
void |
updateSectionStatus(ChunkSectionPos pos,
boolean status) |
applyPendingUpdates, hasPendingUpdates, method_24206, method_24208, propagateLevel, propagateLevel, removePendingUpdate, updateLevelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdateSectionStatusprivate 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 LevelPropagatorprivate 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 LevelPropagatorprotected int recalculateLevel(long id,
long excludedId,
int maxLevel)
recalculateLevel in class LevelPropagatorprotected int getLevel(long id)
getLevel in class LevelPropagatorprotected int getCurrentLevelFromArray(ChunkNibbleArray array, long blockPos)
protected void setLevel(long id,
int level)
setLevel in class LevelPropagatorprotected int getPropagatedLevel(long sourceId,
long targetId,
int level)
getPropagatedLevel in class LevelPropagatorpublic boolean hasUpdates()
public int doLightUpdates(int maxSteps,
boolean doSkylight,
boolean skipEdgeLightPropagation)
protected void setLightArray(long pos,
@Nullable
ChunkNibbleArray lightArray)
@Nullable public ChunkNibbleArray getLightArray(ChunkSectionPos pos)
getLightArray in interface ChunkLightingViewpublic int getLightLevel(BlockPos blockPos)
getLightLevel in interface ChunkLightingView@Environment(value=CLIENT) public String method_22875(long long2)
public void checkBlock(BlockPos pos)
public void addLightSource(BlockPos pos, int level)
public void updateSectionStatus(ChunkSectionPos pos, boolean status)
updateSectionStatus in interface LightingViewpublic void setLightEnabled(ChunkPos pos, boolean lightEnabled)
public void setRetainData(ChunkPos pos, boolean retainData)