Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- init(ChunkGrid, Ref)
- calculateLight(Vector3i)
- invalidateLightAtBlock(ChunkGrid, int, int, int, BlockType, int, int)
- invalidateLightInChunkSections(ChunkGrid, int, int, int, int)
- testNeighboursForLocalLight(ChunkGrid, BlockSection, int, int, int)
- propagateSides(BlockSection, ChunkLightDataBuilder, BitSet)
- propagateEdges(BlockSection, ChunkLightDataBuilder, BitSet)
- propagateCorners(BlockSection, ChunkLightDataBuilder, BitSet)
Class FloodLightCalculation
java.lang.Object
com.hypixel.hytale.server.core.universe.world.lighting.FloodLightCalculation
- All Implemented Interfaces:
LightCalculation
- Since:
- 20/10/17.
- Version:
- 1.0
-
Constructor Summary
Constructors -
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)voidpropagateCorners(BlockSection toSection, ChunkLightDataBuilder globalLight, BitSet bitSetQueue) voidpropagateEdges(BlockSection toSection, ChunkLightDataBuilder globalLight, BitSet bitSetQueue) voidpropagateSides(BlockSection toSection, ChunkLightDataBuilder globalLight, BitSet bitSetQueue) booleantestNeighboursForLocalLight(ChunkGrid chunkGrid, BlockSection blockSection, int chunkX, int chunkY, int chunkZ)
-
Constructor Details
-
FloodLightCalculation
-
-
Method Details
-
init
- Specified by:
initin interfaceLightCalculation
-
calculateLight
Description copied from interface:LightCalculationCalculates the lighting for a chunk section.- Specified by:
calculateLightin interfaceLightCalculation- 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
public boolean invalidateLightAtBlock(@Nonnull ChunkGrid chunkGrid, int blockX, int blockY, int blockZ, @Nonnull BlockType blockType, int oldHeight, int newHeight) Description copied from interface:LightCalculationUpdates or queues an update for lighting at a block position.- Specified by:
invalidateLightAtBlockin interfaceLightCalculation- 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
public boolean invalidateLightInChunkSections(@Nonnull ChunkGrid chunkGrid, int chunkX, int chunkZ, int sectionIndexFrom, int sectionIndexTo) Description copied from interface:LightCalculationUpdates or queues an update for lighting in chunk for sections in rangesectionIndexFrom(inclusive) tosectionIndexTo(exclusive)- Specified by:
invalidateLightInChunkSectionsin interfaceLightCalculation- 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
-
testNeighboursForLocalLight
public boolean testNeighboursForLocalLight(@Nonnull ChunkGrid chunkGrid, @Nonnull BlockSection blockSection, int chunkX, int chunkY, int chunkZ) -
propagateSides
public void propagateSides(@Nonnull BlockSection toSection, @Nonnull ChunkLightDataBuilder globalLight, @Nonnull BitSet bitSetQueue) -
propagateEdges
public void propagateEdges(@Nonnull BlockSection toSection, @Nonnull ChunkLightDataBuilder globalLight, @Nonnull BitSet bitSetQueue) -
propagateCorners
public void propagateCorners(@Nonnull BlockSection toSection, @Nonnull ChunkLightDataBuilder globalLight, @Nonnull BitSet bitSetQueue)
-