Contents
Interface LightCalculation
- All Known Implementing Classes:
FloodLightCalculation, FullBrightLightCalculation
public interface LightCalculation
An interface that represents an approach to calculating lighting in chunks.
-
Method Summary
Modifier and TypeMethodDescriptioncalculateLight(org.joml.Vector3i chunkPosition) Calculates the lighting for a chunk section.voidinit(ChunkGrid chunkGrid, Ref<ChunkStore> sectionRef) booleaninvalidateLightAtBlock(ChunkGrid chunkGrid, int blockX, int blockY, int blockZ, BlockType blockType, int oldHeight, int newHeight) Updates or queues an update for lighting at a block position.booleaninvalidateLightInChunkSections(ChunkGrid chunkGrid, int chunkX, int chunkZ, int sectionIndexFrom, int sectionIndexTo) Updates or queues an update for lighting in chunk for sections in rangesectionIndexFrom(inclusive) tosectionIndexTo(exclusive)
-
Method Details
-
init
-
calculateLight
Calculates the lighting for a chunk section.- Parameters:
chunkPosition- The position of the chunk to calculate lighting for.- Returns:
trueif the chunk was processed andfalseif the chunk is waiting for something
-
invalidateLightAtBlock
boolean invalidateLightAtBlock(@Nonnull ChunkGrid chunkGrid, int blockX, int blockY, int blockZ, @Nonnull BlockType blockType, int oldHeight, int newHeight) Updates or queues an update for lighting at a block position.- Parameters:
chunkGrid- The chunk store containing the block.blockX- The x coordinate of the block.blockY- The y coordinate of the block.blockZ- The z coordinate of the block.blockType- The type of the block.oldHeight- The old height of the block.newHeight- The new height of the block.- Returns:
trueif the update has been handled orfalseif the update is deferred.
-
invalidateLightInChunkSections
boolean invalidateLightInChunkSections(@Nonnull ChunkGrid chunkGrid, int chunkX, int chunkZ, int sectionIndexFrom, int sectionIndexTo) Updates or queues an update for lighting in chunk for sections in rangesectionIndexFrom(inclusive) tosectionIndexTo(exclusive)- Parameters:
chunkGrid- The chunk to update lighting for.chunkX- The chunk x coordinate.chunkZ- The chunk z coordinate.sectionIndexFrom- The section index to start from (inclusive).sectionIndexTo- The section index to end at (exclusive).- Returns:
trueif the update has been handled now
-