Package org.spongepowered.api.world
Interface World<W extends World<W,L>,L extends Location<W,L>>
- 
- All Superinterfaces:
- ArchetypeVolumeCreator,- Audience,- BiomeVolume,- BiomeVolume.Modifiable<W>,- BiomeVolume.Streamable<W>,- BlockEntityVolume,- BlockEntityVolume.Modifiable<W>,- BlockEntityVolume.Streamable<W>,- BlockVolume,- BlockVolume.Modifiable<W>,- BlockVolume.Streamable<W>,- ChunkVolume,- ContextSource,- EntityVolume,- EntityVolume.Modifiable<W>,- EntityVolume.Streamable<W>,- EnvironmentalVolume,- ForwardingAudience,- GenerationVolume,- GenerationVolume.Mutable,- HeightAwareVolume,- LocationBaseDataHolder,- LocationBaseDataHolder.Mutable,- LocationCreator<W,L>,- MutableGameVolume,- MutableVolume,- PhysicsAwareMutableBlockVolume<W>,- Pointered,- PrimitiveGameVolume,- RandomProvider,- Region<W>,- RegistryHolder,- UpdatableVolume,- Viewer,- Volume,- WeatherUniverse,- WorldLike<W>
 - All Known Subinterfaces:
- ClientWorld,- ServerWorld
 
 @DoNotStore public interface World<W extends World<W,L>,L extends Location<W,L>> extends ForwardingAudience, WorldLike<W>, LocationCreator<W,L>, PhysicsAwareMutableBlockVolume<W>, ContextSource, Viewer, ArchetypeVolumeCreator, WeatherUniverse, RegistryHolder A loaded Minecraft world.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolumeBiomeVolume.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.BlockEntityVolumeBlockEntityVolume.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.BlockVolumeBlockVolume.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.entity.EntityVolumeEntityVolume.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 net.kyori.adventure.audience.ForwardingAudienceForwardingAudience.Single
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.game.GenerationVolumeGenerationVolume.Mutable
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolderLocationBaseDataHolder.Mutable
 - 
Nested classes/interfaces inherited from interface org.spongepowered.api.world.weather.WeatherUniverseWeatherUniverse.Mutable
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Iterable<? extends Audience>audiences()WorldChunkchunk(int cx, int cy, int cz)Gets the loaded chunk at the given chunk coordinate position.default WorldChunkchunk(Vector3i chunkPos)Gets the loaded chunk at the given chunk coordinate position.WorldChunkchunkAtBlock(int bx, int by, int bz)Gets the loaded chunk at the given chunk coordinate position.WorldChunkchunkAtBlock(Vector3i blockPosition)Gets the loaded chunk at the given block coordinate position.default java.util.Optional<? extends Player>closestPlayer(int x, int y, int z, double distance)java.util.Optional<? extends Player>closestPlayer(int x, int y, int z, double distance, java.util.function.Predicate<? super Player> predicate)default java.util.Optional<? extends Player>closestPlayer(Entity entity, double distance)default java.util.Optional<? extends Player>closestPlayer(Entity entity, double distance, java.util.function.Predicate<? super Player> predicate)default java.util.Optional<? extends Player>closestPlayer(Vector3i position, double distance)default java.util.Optional<? extends Player>closestPlayer(Vector3i position, double distance, java.util.function.Predicate<? super Player> predicate)booleanisLoaded()Gets if this world is currently loaded.java.util.Optional<WorldChunk>loadChunk(int cx, int cy, int cz, boolean shouldGenerate)Gets the chunk at the given chunk coordinate position if it exists or ifshouldGenerateis true and the chunk is generated.default java.util.Optional<WorldChunk>loadChunk(Vector3i chunkPosition, boolean shouldGenerate)Gets the chunk at the given chunk coordinate position if it exists or ifshouldGenerateis true and the chunk is generated.java.lang.Iterable<WorldChunk>loadedChunks()Returns a Collection of all actively loaded chunks in this world.java.util.Collection<? extends Player>players()Gets an unmodifiable collection ofplayerscurrently in this world.WorldPropertiesproperties()Gets theproperties.default Wworld()- 
Methods inherited from interface org.spongepowered.api.world.volume.archetype.ArchetypeVolumeCreatorcreateArchetypeVolume
 - 
Methods inherited from interface net.kyori.adventure.audience.AudiencedeleteMessage, openBook, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, showTitle, stopSound
 - 
Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolumebiome, biome
 - 
Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolume.ModifiablesetBiome, setBiome
 - 
Methods inherited from interface org.spongepowered.api.world.volume.biome.BiomeVolume.StreamablebiomeStream
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolumeblockEntities, blockEntities, blockEntity, blockEntity
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume.ModifiableaddBlockEntity, addBlockEntity, removeBlockEntity, removeBlockEntity
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.entity.BlockEntityVolume.StreamableblockEntityStream
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolumeblock, block, fluid, fluid, highestPositionAt, highestYAt, highestYAt
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.StreamableblockStateStream
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.ChunkVolumechunkLayout, hasChunk, hasChunk, hasChunkAtBlock, hasChunkAtBlock, isChunkLoaded, isChunkLoaded, isChunkLoadedAtBlock, isChunkLoadedAtBlock
 - 
Methods inherited from interface org.spongepowered.api.service.context.ContextSourcecontext
 - 
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolumeentities, entities, entities, entities, entities, entity, nearbyEntities, nearestPlayer
 - 
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume.ModifiablecreateEntity, createEntity, createEntity, createEntity, createEntity, createEntity, createEntityNaturally, createEntityNaturally, createEntityNaturally, createEntityNaturally, spawnEntities, spawnEntity
 - 
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume.StreamableentityStream
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.EnvironmentalVolumeisSkylightMax, light, light, light, light, light, light
 - 
Methods inherited from interface net.kyori.adventure.audience.ForwardingAudienceclearTitle, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, stopSound
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.GenerationVolumehasBlockState, hasBlockState, hasBlockState, maximumHeight
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.HeightAwareVolumeheight, height
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolderget, 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.MutablecopyFrom, 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.LocationCreatorlocation, location, location, location
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.MutableGameVolumedestroyBlock, spawnEntity
 - 
Methods inherited from interface org.spongepowered.api.world.volume.block.PhysicsAwareMutableBlockVolumesetBlock, setBlock, setBlock, setBlock
 - 
Methods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFrom
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.PrimitiveGameVolumeemittedLight, emittedLight, height, maximumLight
 - 
Methods inherited from interface org.spongepowered.api.util.RandomProviderrandom
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.Regionborder, canSeeSky, canSeeSky, containsAnyLiquids, hasLiquid, hasLiquid, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isAreaLoaded, isBlockLoaded, isBlockLoaded, isBlockLoaded, isBlockLoaded, isCollisionBoxesEmpty, isInBorder, seaLevel, setBorder, skylightSubtracted, worldType
 - 
Methods inherited from interface org.spongepowered.api.registry.RegistryHolderfindRegistry, registry, streamRegistries
 - 
Methods inherited from interface org.spongepowered.api.world.volume.game.UpdatableVolumescheduledBlockUpdates, scheduledFluidUpdates
 - 
Methods inherited from interface org.spongepowered.api.effect.ViewerplayMusicDisc, playSound, resetBlockChange, resetBlockChange, sendBlockChange, sendBlockChange, sendWorldType, spawnParticles, spawnParticles, stopMusicDisc
 - 
Methods inherited from interface org.spongepowered.api.world.volume.Volumeavailable, contains, contains, isAreaAvailable, max, min, size
 - 
Methods inherited from interface org.spongepowered.api.world.weather.WeatherUniverseweather
 - 
Methods inherited from interface org.spongepowered.api.world.WorldLikedifficulty, engine, removeBlock, removeBlock, seed, setBlock, setBlock
 
- 
 
- 
- 
- 
Method Detail- 
propertiesWorldProperties properties() Gets theproperties.- Returns:
- The properties
 
 - 
worlddefault W world() 
 - 
isLoadedboolean isLoaded() Gets if this world is currently loaded.An assumption can be made that if this returns false, this is considered a stale object. - Returns:
- True if loaded, false if not
 
 - 
playersjava.util.Collection<? extends Player> players() Gets an unmodifiable collection ofplayerscurrently in this world.- Specified by:
- playersin interface- EntityVolume
- Returns:
- The players
 
 - 
audiencesdefault java.lang.Iterable<? extends Audience> audiences() - Specified by:
- audiencesin interface- ForwardingAudience
 
 - 
closestPlayerdefault java.util.Optional<? extends Player> closestPlayer(Vector3i position, double distance) 
 - 
closestPlayerdefault java.util.Optional<? extends Player> closestPlayer(Vector3i position, double distance, java.util.function.Predicate<? super Player> predicate) 
 - 
closestPlayerdefault java.util.Optional<? extends Player> closestPlayer(Entity entity, double distance) 
 - 
closestPlayerdefault java.util.Optional<? extends Player> closestPlayer(Entity entity, double distance, java.util.function.Predicate<? super Player> predicate) 
 - 
closestPlayerdefault java.util.Optional<? extends Player> closestPlayer(int x, int y, int z, double distance) 
 - 
closestPlayerjava.util.Optional<? extends Player> closestPlayer(int x, int y, int z, double distance, java.util.function.Predicate<? super Player> predicate) 
 - 
chunkAtBlockWorldChunk chunkAtBlock(Vector3i blockPosition) Gets the loaded chunk at the given block coordinate position. This gets a guaranteedWorldChunkat the desired block position; however, theWorldChunkinstance may beempty, and likewise, may not be generated, valid, pre-existing. It is important to check for these cases prior to attempting to modify the chunk.Note that this is still different from chunk(Vector3i)due to it being a relative block position which can vary depending on implementation and other mods installed.- Specified by:
- chunkAtBlockin interface- ChunkVolume
- Parameters:
- blockPosition- The block position to be transformed for relative chunk position
- Returns:
- The available chunk at that position
 
 - 
chunkAtBlockWorldChunk chunkAtBlock(int bx, int by, int bz) Gets the loaded chunk at the given chunk coordinate position. The position is the block position relative to theChunk.chunkPosition(), and therefor is going to return a different chunk fromChunkVolume.chunk(Vector3i). This is more usable fromServerLocations or aLocatablethat returns apositionin relation to aWorldLike. This gets a guaranteedWorldChunkat the desired block position; however, theWorldChunkinstance may beempty, and likewise, may not be generated, valid, pre-existing. It is important to check for these cases prior to attempting to modify the chunk.Note that this is still different from chunk(Vector3i)due to the relative block position dictated byServer.chunkLayout(), which can vary depending on implementation and other mods installed.- Specified by:
- chunkAtBlockin interface- ChunkVolume
- Parameters:
- bx- The block x coordinate
- by- The block y coordinate
- bz- The block z coordinate
- Returns:
- The available chunk at that position
 
 - 
chunkdefault WorldChunk chunk(Vector3i chunkPos) Gets the loaded chunk at the given chunk coordinate position. The position is the same asChunk.chunkPosition(). The difference between a block placed within aWorldLikeis different from aChunk's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunkisemptyor not, nor thestateof the chunk. This gets a guaranteedWorldChunkat the desired chunk position; however, theWorldChunkinstance may beempty, and likewise, may not be generated, valid, pre-existing. It is important to check for these cases prior to attempting to modify the chunk.- Specified by:
- chunkin interface- ChunkVolume
- Parameters:
- chunkPos- The chunk position relative to the- chunk layout
- Returns:
- The available chunk at that position
 
 - 
chunkWorldChunk chunk(int cx, int cy, int cz) Gets the loaded chunk at the given chunk coordinate position. The position is the same asChunk.chunkPosition(). The difference between a block placed within aWorldLikeis different from aChunk's position, and therefore care should be taken when requesting a chunk. It is not guaranteed that the returnedChunkisemptyor not, nor thestateof the chunk.In Vanilla, the y coordinate will always be 0. This gets a guaranteedWorldChunkat the desired chunk position; however, theWorldChunkinstance may beempty, and likewise, may not be generated, valid, pre-existing. It is important to check for these cases prior to attempting to modify the chunk.- Specified by:
- chunkin interface- ChunkVolume
- Parameters:
- cx- The x chunk coordinate
- cy- The y coordinate
- cz- The z chunk coordinate
- Returns:
- The available chunk at the chunk position
 
 - 
loadChunkdefault java.util.Optional<WorldChunk> loadChunk(Vector3i chunkPosition, boolean shouldGenerate) Gets the chunk at the given chunk coordinate position if it exists or ifshouldGenerateis true and the chunk is generated.- Parameters:
- chunkPosition- The position
- shouldGenerate- True to generate a new chunk
- Returns:
- The loaded or generated chunk, if already generated
 
 - 
loadChunkjava.util.Optional<WorldChunk> loadChunk(int cx, int cy, int cz, boolean shouldGenerate) Gets the chunk at the given chunk coordinate position if it exists or ifshouldGenerateis true and the chunk is generated.In Vanilla, the y coordinate will always be 0. - Parameters:
- cx- The x coordinate
- cy- The y coordinate
- cz- The z coordinate
- shouldGenerate- True to generate a new chunk
- Returns:
- The loaded or generated chunk, if already generated
 
 - 
loadedChunksjava.lang.Iterable<WorldChunk> loadedChunks() Returns a Collection of all actively loaded chunks in this world.The ordering of the returned chunks is undefined. - Returns:
- The loaded chunks
 
 
- 
 
-