Interface Chunk<P extends Chunk<P>>
- All Superinterfaces:
BiomeVolume, BiomeVolume.Modifiable<P>, BiomeVolume.Streamable<P>, BlockEntityVolume, BlockEntityVolume.Modifiable<P>, BlockEntityVolume.Streamable<P>, BlockVolume, BlockVolume.Modifiable<P>, BlockVolume.Streamable<P>, HeightAwareVolume, LocationBaseDataHolder, LocationBaseDataHolder.Mutable, MutableVolume, UpdatableVolume, Volume
- All Known Subinterfaces:
GenerationChunk, WorldChunk
WorldLike.
Chunk is exposed as a superinterface due to the nature of needing
chunk like structures for various purposes, whether it's for world generation,
chunk loading from storage, or empty chunks on clients. Traditionally, a
usable "live" proto chunk instance will be a WorldChunk with a valid
World instance.
A chunk may not be attached to a World or GenerationRegion
if it is in the process of being generated.
-
Nested Class Summary
Nested classes/interfaces inherited from interface BiomeVolume
BiomeVolume.Immutable, BiomeVolume.Modifiable<M>, BiomeVolume.Mutable, BiomeVolume.Streamable<B>, BiomeVolume.Unmodifiable<U>Nested classes/interfaces inherited from interface BlockEntityVolume
BlockEntityVolume.Modifiable<M>, BlockEntityVolume.Mutable, BlockEntityVolume.Streamable<T>, BlockEntityVolume.Unmodifiable<U>Nested classes/interfaces inherited from interface BlockVolume
BlockVolume.Immutable, BlockVolume.Modifiable<M>, BlockVolume.Mutable, BlockVolume.Streamable<B>, BlockVolume.Unmodifiable<U>Nested classes/interfaces inherited from interface LocationBaseDataHolder
LocationBaseDataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionvoidGets the position of the chunk.Gets thenumber of ticksplayers have been present in this chunk, used for calculation of the regional difficulty factor.booleanisEmpty()Gets whether this chunk is empty.voidsetInhabitedTime(Ticks newInhabitedTime) Sets thenumber of ticksplayers have been present in this chunk.state()Gets thisChunk's currentChunkState.Methods inherited from interface BiomeVolume
biome, biomeMethods inherited from interface BiomeVolume.Modifiable
setBiome, setBiomeMethods inherited from interface BiomeVolume.Streamable
biomeStreamMethods inherited from interface BlockEntityVolume
blockEntities, blockEntities, blockEntity, blockEntityMethods inherited from interface BlockEntityVolume.Modifiable
addBlockEntity, addBlockEntity, removeBlockEntity, removeBlockEntityMethods inherited from interface BlockEntityVolume.Streamable
blockEntityStreamMethods inherited from interface BlockVolume
block, block, blockPalette, fluid, fluid, highestPositionAt, highestYAt, highestYAtMethods inherited from interface BlockVolume.Modifiable
removeBlock, removeBlock, setBlock, setBlockMethods inherited from interface BlockVolume.Streamable
blockStateStreamMethods inherited from interface HeightAwareVolume
height, heightMethods inherited from interface LocationBaseDataHolder
get, get, get, get, getDouble, getDouble, getDouble, getDouble, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getValue, getValue, getValue, getValue, getValues, getValues, keys, keys, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orNull, orNull, orNull, orNull, require, require, require, require, supports, supports, supports, supports, supports, supportsMethods inherited from interface LocationBaseDataHolder.Mutable
copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, offer, offer, offer, offer, offer, offer, remove, remove, remove, remove, setRawData, setRawData, transform, transform, transform, transform, undo, undo, validateRawData, validateRawDataMethods inherited from interface UpdatableVolume
scheduledBlockUpdates, scheduledFluidUpdates
-
Method Details
-
addEntity
Adds theEntityto thischunk. It is not guaranteed this will succeed in all cases, asstate()does play a role in whether an entity can be directly added or not.This method should realistically be used only during world generation, and therefore will likely emit warnings if attempting to add entities to live
WorldChunkinstances.- Parameters:
entity- The entity to add
-
state
ChunkState state()Gets thisChunk's currentChunkState. TheChunkStatestipulates the potential validity of various operations that can be performed.A fully generated chunk will return
ChunkStates.FULL- though care should be taken as the chunk may be anemptyone.- Returns:
- This chunk's state
-
isEmpty
boolean isEmpty()Gets whether this chunk is empty.- Returns:
- Whether this chunk is empty
-
chunkPosition
Vector3i chunkPosition()Gets the position of the chunk.The returned position is 3-dimensional with the Y-coordinate set to be the base (lowest) Y-position of the chunk. As 3-dimensional chunks do not yet exist in Minecraft, the returned position will always have a
yset to 0.- Returns:
- The position
-
inhabitedTime
Ticks inhabitedTime()Gets thenumber of ticksplayers have been present in this chunk, used for calculation of the regional difficulty factor. In vanilla, it is increased by the number of players in the chunk every tick, and is capped at 3,600,000 ticks (50 hours).- Returns:
- The number of ticks
-
setInhabitedTime
Sets thenumber of ticksplayers have been present in this chunk.- Parameters:
newInhabitedTime- TheTicksto set this value to- Throws:
IllegalArgumentException- If the inhabited time is infinite- See Also:
-