Class LightingChunk
java.lang.Object
net.minestom.server.instance.Chunk
net.minestom.server.instance.DynamicChunk
net.minestom.server.instance.LightingChunk
- All Implemented Interfaces:
Block.Getter, Block.Setter, Snapshotable, Taggable, TagReadable, TagWritable, Tickable, Viewable, Biome.Getter, Biome.Setter
A chunk which supports lighting computation.
This chunk is used to compute the light data for each block.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Block.Getter
Block.Getter.Condition -
Field Summary
Fields inherited from class DynamicChunk
entries, motionBlocking, sections, tickableMap, worldSurfaceFields inherited from class Chunk
CHUNK_SECTION_SIZE, CHUNK_SIZE_X, CHUNK_SIZE_Z, chunkX, chunkZ, instance, loaded, maxSection, minSection -
Constructor Summary
ConstructorsModifierConstructorDescriptionLightingChunk(Instance instance, int chunkX, int chunkZ) protectedLightingChunk(Instance instance, int chunkX, int chunkZ, List<Section> sections) -
Method Summary
Modifier and TypeMethodDescriptionCreates a copy of this chunk, including blocks state id, custom block id, biomes, update data.protected LightDatacreateLightData(boolean requiredFullChunk) int[]voidInvalidate the chunk cachesvoidinvalidateNeighborsSection(int coordinate) voidbooleanisLoaded()Used to verify if the chunk should still be kept in memory.voidCalled when the chunk generator has finished generating the chunk.protected voidonLoad()Called when the chunk has been successfully loaded.relight(Instance instance, Collection<Chunk> chunks) Forces a relight of the specified chunks.voidvoidsetBlock(int x, int y, int z, Block block, BlockHandler.Placement placement, BlockHandler.Destroy destroy) voidsetFreezeInvalidation(boolean freezeInvalidation) voidtick(long time) Executes a chunk tick.Methods inherited from class DynamicChunk
getBiome, getBlock, getFullDataPacket, getHeightmaps, getSection, getSections, loadHeightmapsFromNBT, motionBlockingHeightmap, reset, setBiome, updateSnapshot, worldSurfaceHeightmapMethods inherited from class Chunk
addViewer, getChunkX, getChunkZ, getIdentifier, getInstance, getMaxSection, getMinSection, getSectionAt, getViewers, isReadOnly, removeViewer, sendChunk, sendChunk, setBlock, setReadOnly, shouldGenerate, tagHandler, toPosition, toString, unloadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Biome.Getter
getBiomeMethods inherited from interface Biome.Setter
setBiomeMethods inherited from interface Block.Getter
getBlock, getBlock, getBlockMethods inherited from interface Block.Setter
setBlock, setBlockAreaMethods inherited from interface Taggable
getAndSetTag, getAndUpdateTag, getTag, hasTag, removeTag, setTag, updateAndGetTag, updateTagMethods inherited from interface Viewable
getViewersAsAudience, getViewersAsAudiences, isViewer, sendPacketsToViewers, sendPacketsToViewers, sendPacketToViewers, sendPacketToViewersAndSelf
-
Constructor Details
-
LightingChunk
-
LightingChunk
-
-
Method Details
-
invalidate
public void invalidate()Description copied from class:ChunkInvalidate the chunk caches- Overrides:
invalidatein classDynamicChunk
-
setFreezeInvalidation
public void setFreezeInvalidation(boolean freezeInvalidation) -
invalidateNeighborsSection
public void invalidateNeighborsSection(int coordinate) -
invalidateResendDelay
public void invalidateResendDelay() -
setBlock
public void setBlock(int x, int y, int z, Block block, @Nullable BlockHandler.Placement placement, @Nullable BlockHandler.Destroy destroy) - Overrides:
setBlockin classDynamicChunk
-
sendLighting
public void sendLighting() -
onLoad
-
onGenerate
public void onGenerate()Description copied from class:ChunkCalled when the chunk generator has finished generating the chunk.- Overrides:
onGeneratein classChunk
-
getOcclusionMap
public int[] getOcclusionMap() -
createLightData
- Overrides:
createLightDatain classDynamicChunk
-
tick
public void tick(long time) Description copied from class:ChunkExecutes a chunk tick.Should be used to update all the blocks in the chunk.
WARNING: this method doesn't necessary have to be thread-safe, proceed with caution.
- Specified by:
tickin interfaceTickable- Overrides:
tickin classDynamicChunk- Parameters:
time- the time of the update in milliseconds
-
relight
Forces a relight of the specified chunks.This method is used to force a relight of the specified chunks.
This method is thread-safe and can be called from any thread.
- Parameters:
instance- the instancechunks- the chunks to relight- Returns:
- the chunks which have been relighted
-
copy
Description copied from class:ChunkCreates a copy of this chunk, including blocks state id, custom block id, biomes, update data.The chunk position (X/Z) can be modified using the given arguments.
- Overrides:
copyin classDynamicChunk- Parameters:
instance- the chunk ownerchunkX- the chunk X of the copychunkZ- the chunk Z of the copy- Returns:
- a copy of this chunk with a potentially new instance and position
-
isLoaded
-