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 org.spongepowered.api.world.volume.biome.BiomeVolume
BiomeVolume.Immutable, BiomeVolume.Modifiable<M extends BiomeVolume.Modifiable<M>>, BiomeVolume.Mutable, BiomeVolume.Streamable<B extends BiomeVolume.Streamable<B>>, BiomeVolume.Unmodifiable<U extends BiomeVolume.Unmodifiable<U>>
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume
BlockEntityVolume.Modifiable<M extends BlockEntityVolume.Modifiable<M>>, BlockEntityVolume.Mutable, BlockEntityVolume.Streamable<T extends BlockEntityVolume.Streamable<T>>, BlockEntityVolume.Unmodifiable<U extends BlockEntityVolume.Unmodifiable<U>>
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.block.BlockVolume
BlockVolume.Immutable, BlockVolume.Modifiable<M extends BlockVolume.Modifiable<M>>, BlockVolume.Mutable, BlockVolume.Streamable<B extends BlockVolume.Streamable<B>>, BlockVolume.Unmodifiable<U extends BlockVolume.Unmodifiable<U>>
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolder
LocationBaseDataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Gets the position of the chunk.Gets thenumber of ticks
players have been present in this chunk, used for calculation of the regional difficulty factor.boolean
isEmpty()
Gets whether this chunk is empty.void
setInhabitedTime
(Ticks newInhabitedTime) Sets thenumber of ticks
players have been present in this chunk.state()
Gets thisChunk
's currentChunkState
.Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolume
biome, biome
Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolume.Modifiable
setBiome, setBiome
Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolume.Streamable
biomeStream
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume
blockEntities, blockEntities, blockEntity, blockEntity
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume.Modifiable
addBlockEntity, addBlockEntity, removeBlockEntity, removeBlockEntity
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume.Streamable
blockEntityStream
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume
block, block, blockPalette, fluid, fluid, highestPositionAt, highestYAt, highestYAt
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.Modifiable
removeBlock, removeBlock, setBlock, setBlock
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.Streamable
blockStateStream
Methods inherited from interface org.spongepowered.api.world.volume.game.HeightAwareVolume
height, height
Methods inherited from interface org.spongepowered.api.world.volume.game.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, supports
Methods inherited from interface org.spongepowered.api.world.volume.game.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, validateRawData
Methods inherited from interface org.spongepowered.api.world.volume.game.UpdatableVolume
scheduledBlockUpdates, scheduledFluidUpdates
-
Method Details
-
addEntity
Adds theEntity
to 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
WorldChunk
instances.- Parameters:
entity
- The entity to add
-
state
ChunkState state()Gets thisChunk
's currentChunkState
. TheChunkState
stipulates 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 anempty
one.- 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
y
set to 0.- Returns:
- The position
-
inhabitedTime
Ticks inhabitedTime()Gets thenumber of ticks
players 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 ticks
players have been present in this chunk.- Parameters:
newInhabitedTime
- TheTicks
to set this value to- Throws:
IllegalArgumentException
- If the inhabited time is infinite- See Also:
-