Interface WorldChunk
- All Superinterfaces:
BiomeVolume
,BiomeVolume.Modifiable<WorldChunk>
,BiomeVolume.Streamable<WorldChunk>
,BlockEntityVolume
,BlockEntityVolume.Modifiable<WorldChunk>
,BlockEntityVolume.Streamable<WorldChunk>
,BlockVolume
,BlockVolume.Modifiable<WorldChunk>
,BlockVolume.Streamable<WorldChunk>
,Chunk<WorldChunk>
,DataHolder
,DataHolder.Mutable
,EntityVolume
,EntityVolume.Modifiable<WorldChunk>
,EntityVolume.Streamable<WorldChunk>
,HeightAwareVolume
,LocationBaseDataHolder
,LocationBaseDataHolder.Mutable
,MutableVolume
,PhysicsAwareMutableBlockVolume<WorldChunk>
,UpdatableVolume
,ValueContainer
,Volume
public interface WorldChunk
extends Chunk<WorldChunk>, EntityVolume.Modifiable<WorldChunk>, PhysicsAwareMutableBlockVolume<WorldChunk>, DataHolder.Mutable
A chunk is a specific grid-aligned partition of a
World
.
In Minecraft, the chunk is 16 by 16 blocks on the X and Z axes. The height of each chunk varies between worlds.
-
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.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume
EntityVolume.EntityVolumeFactory, EntityVolume.Immutable, EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>, EntityVolume.Mutable, EntityVolume.Streamable<E extends EntityVolume.Streamable<E>>, EntityVolume.Unmodifiable<U extends EntityVolume.Unmodifiable<U>>
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolder
LocationBaseDataHolder.Mutable
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional
<WorldChunk> Gets the chunk in the given direction from this chunk, if it exists.default Optional
<WorldChunk> Gets the chunk in the given direction from this chunk.double
Gets the regional difficulty factor for this chunk.double
Gets the regional difficulty percentage for this chunk.World
<?, ?> world()
Gets the world the chunk is in.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
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.Streamable
blockStateStream
Methods inherited from interface org.spongepowered.api.world.chunk.Chunk
addEntity, chunkPosition, inhabitedTime, isEmpty, setInhabitedTime, state
Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undo
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume
entities, entities, entities, entities, entities, entity, nearbyEntities, nearestPlayer, players
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume.Modifiable
createEntity, createEntity, createEntity, createEntity, createEntity, createEntity, createEntityNaturally, createEntityNaturally, createEntityNaturally, createEntityNaturally, spawnEntities, spawnEntity
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume.Streamable
entityStream
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.block.PhysicsAwareMutableBlockVolume
setBlock, setBlock, setBlock, setBlock
Methods inherited from interface org.spongepowered.api.world.volume.game.UpdatableVolume
scheduledBlockUpdates, scheduledFluidUpdates
-
Method Details
-
world
World<?,?> world()Gets the world the chunk is in.- Returns:
- The world
-
neighbor
Gets the chunk in the given direction from this chunk, if it exists.- Parameters:
direction
- The cardinal or ordinal direction to get the chunk from- Returns:
- The neighbor chunk, if available
-
neighbor
Gets the chunk in the given direction from this chunk.- Parameters:
direction
- The cardinal or ordinal direction to get the chunk fromshouldLoad
- Whether the server should load or generate the chunk if unavailable- Returns:
- The neighbor chunk, if available or if
shouldLoad
is true
-
regionalDifficultyFactor
double regionalDifficultyFactor()Gets the regional difficulty factor for this chunk. In vanilla, it is dependent on the playtime of the world, inhabited time of the chunk, the phase of the moon, and the current difficulty setting. This number ranges from 0.75-1.5 on easy, 1.5-4.0 on normal, and 2.25-6.75 on hard.This value is used for display only in vanilla.
- Returns:
- The regional difficulty factor for this chunk
-
regionalDifficultyPercentage
double regionalDifficultyPercentage()Gets the regional difficulty percentage for this chunk. It is calculated by taking the regional difficulty factor and using the following rules: If the factor is less than 2.0, the percentage is 0%. If the factor is greater than 4.0, the percentage is 100%. Otherwise, the percentage is the factor minus 2.0, divided by 2.0.This is the value that is used in vanilla to find which effects are caused by the regional difficulty.
- Returns:
- The regional difficulty percentage for this chunk
-