Package org.bukkit
Interface Chunk
- All Superinterfaces:
- PersistentDataHolder
Represents a chunk of blocks
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddPluginChunkTicket(Plugin plugin) Adds a plugin ticket for this chunk, loading this chunk if it is not already loaded.booleanTests if this chunk contains the specified block.getBlock(int x, int y, int z) Gets a block from this chunkCapture thread-safe read-only snapshot of chunk datagetChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) Capture thread-safe read-only snapshot of chunk dataEntity[]Get a list of all entities in the chunk.longGets the amount of time in ticks that this chunk has been inhabited.Retrieves a collection specifying which plugins have tickets for this chunk.Get a list of all tile entities in the chunk.getWorld()Gets the world containing this chunkintgetX()Gets the X-coordinate of this chunkintgetZ()Gets the Z-coordinate of this chunkbooleanChecks if entities in this chunk are loaded.booleanGets whether the chunk at the specified chunk coordinates is force loaded.booleanisLoaded()Checks if the chunk is loaded.booleanChecks if this chunk can spawn slimes without being a swamp biome.booleanload()Loads the chunk.booleanload(boolean generate) Loads the chunk.booleanremovePluginChunkTicket(Plugin plugin) Removes the specified plugin's ticket for this chunkvoidsetForceLoaded(boolean forced) Sets whether the chunk at the specified chunk coordinates is force loaded.voidsetInhabitedTime(long ticks) Sets the amount of time in ticks that this chunk has been inhabited.booleanunload()Unloads and optionally saves the Chunkbooleanunload(boolean save) Unloads and optionally saves the ChunkMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainer
- 
Method Details- 
getXint getX()Gets the X-coordinate of this chunk- Returns:
- X-coordinate
 
- 
getZint getZ()Gets the Z-coordinate of this chunk- Returns:
- Z-coordinate
 
- 
getWorldGets the world containing this chunk- Returns:
- Parent World
 
- 
getBlockGets a block from this chunk- Parameters:
- x- 0-15
- y- world minHeight (inclusive) - world maxHeight (exclusive)
- z- 0-15
- Returns:
- the Block
 
- 
getChunkSnapshotCapture thread-safe read-only snapshot of chunk data- Returns:
- ChunkSnapshot
 
- 
getChunkSnapshot@NotNull ChunkSnapshot getChunkSnapshot(boolean includeMaxblocky, boolean includeBiome, boolean includeBiomeTempRain) Capture thread-safe read-only snapshot of chunk data- Parameters:
- includeMaxblocky- - if true, snapshot includes per-coordinate maximum Y values
- includeBiome- - if true, snapshot includes per-coordinate biome type
- includeBiomeTempRain- - if true, snapshot includes per-coordinate raw biome temperature and rainfall
- Returns:
- ChunkSnapshot
 
- 
isEntitiesLoadedboolean isEntitiesLoaded()Checks if entities in this chunk are loaded.- Returns:
- True if entities are loaded.
 
- 
getEntitiesGet a list of all entities in the chunk. This will force load any entities, which are not loaded.- Returns:
- The entities.
 
- 
getTileEntitiesGet a list of all tile entities in the chunk.- Returns:
- The tile entities.
 
- 
isLoadedboolean isLoaded()Checks if the chunk is loaded.- Returns:
- True if it is loaded.
 
- 
loadboolean load(boolean generate) Loads the chunk.- Parameters:
- generate- Whether or not to generate a chunk if it doesn't already exist
- Returns:
- true if the chunk has loaded successfully, otherwise false
 
- 
loadboolean load()Loads the chunk.- Returns:
- true if the chunk has loaded successfully, otherwise false
 
- 
unloadboolean unload(boolean save) Unloads and optionally saves the Chunk- Parameters:
- save- Controls whether the chunk is saved
- Returns:
- true if the chunk has unloaded successfully, otherwise false
 
- 
unloadboolean unload()Unloads and optionally saves the Chunk- Returns:
- true if the chunk has unloaded successfully, otherwise false
 
- 
isSlimeChunkboolean isSlimeChunk()Checks if this chunk can spawn slimes without being a swamp biome.- Returns:
- true if slimes are able to spawn in this chunk
 
- 
isForceLoadedboolean isForceLoaded()Gets whether the chunk at the specified chunk coordinates is force loaded.A force loaded chunk will not be unloaded due to lack of player activity. - Returns:
- force load status
- See Also:
 
- 
setForceLoadedvoid setForceLoaded(boolean forced) Sets whether the chunk at the specified chunk coordinates is force loaded.A force loaded chunk will not be unloaded due to lack of player activity. - Parameters:
- forced- force load status
- See Also:
 
- 
addPluginChunkTicketAdds a plugin ticket for this chunk, loading this chunk if it is not already loaded.A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets. - Parameters:
- plugin- Plugin which owns the ticket
- Returns:
- trueif a plugin ticket was added,- falseif the ticket already exists for the plugin
- Throws:
- IllegalStateException- If the specified plugin is not enabled
- See Also:
 
- 
removePluginChunkTicketRemoves the specified plugin's ticket for this chunkA plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets. - Parameters:
- plugin- Plugin which owns the ticket
- Returns:
- trueif the plugin ticket was removed,- falseif there is no plugin ticket for the chunk
- See Also:
 
- 
getPluginChunkTicketsRetrieves a collection specifying which plugins have tickets for this chunk. This collection is not updated when plugin tickets are added or removed to this chunk.A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets. - Returns:
- unmodifiable collection containing which plugins have tickets for this chunk
- See Also:
 
- 
getInhabitedTimelong getInhabitedTime()Gets the amount of time in ticks that this chunk has been inhabited. Note that the time is incremented once per tick per player in the chunk.- Returns:
- inhabited time
 
- 
setInhabitedTimevoid setInhabitedTime(long ticks) Sets the amount of time in ticks that this chunk has been inhabited.- Parameters:
- ticks- new inhabited time
 
- 
containsTests if this chunk contains the specified block.- Parameters:
- block- block to test
- Returns:
- if the block is contained within
 
 
-