public interface World extends Extent, WeatherUniverse, Viewer, Contextual
Modifier and Type | Method and Description |
---|---|
boolean |
doesKeepSpawnLoaded()
Returns whether this
World 's spawn chunks remain loaded when no
players are present. |
Optional<Chunk> |
getChunk(int x,
int y,
int z)
Get the loaded chunk at the given position.
|
Optional<Chunk> |
getChunk(com.flowpowered.math.vector.Vector3i position)
Get the loaded chunk at the given position.
|
WorldCreationSettings |
getCreationSettings()
Gets the
WorldCreationSettings which were used to create this
world. |
Difficulty |
getDifficulty()
Gets the
Difficulty setting for this world. |
Dimension |
getDimension()
Returns the
Dimension of this world. |
Optional<Entity> |
getEntity(UUID uuid)
Gets the entity whose
UUID matches the provided id, possibly
returning no entity if the entity is not loaded or non-existant. |
Optional<String> |
getGameRule(String gameRule)
Gets the specified GameRule value.
|
Map<String,String> |
getGameRules()
Gets a map of the currently set game rules and their values.
|
Iterable<Chunk> |
getLoadedChunks()
Returns a Collection of all actively loaded chunks in this world.
|
default Location<World> |
getLocation(double x,
double y,
double z)
Gets a location in this extent at the given position.
|
default Location<World> |
getLocation(int x,
int y,
int z)
Gets a location in this extent at the given position.
|
default Location<World> |
getLocation(com.flowpowered.math.vector.Vector3d position)
Gets a location in this extent at the given position.
|
default Location<World> |
getLocation(com.flowpowered.math.vector.Vector3i position)
Gets a location in this extent at the given position.
|
String |
getName()
Gets the name of the world.
|
PlayerSimulator |
getPlayerSimulator()
Gets the world's player simulator, used for simulating player actions
|
WorldProperties |
getProperties()
Gets the properties for this world.
|
Scoreboard |
getScoreboard()
Gets the @link Scoreboard} for this world.
|
Location<World> |
getSpawnLocation()
Gets the
Location of the spawn point. |
TeleporterAgent |
getTeleporterAgent()
Gets the teleporter agent, used for manipulating teleporters.
|
WorldBorder |
getWorldBorder()
Gets the world border for the world.
|
WorldGenerator |
getWorldGenerator()
Gets the
WorldGenerator for this world. |
WorldStorage |
getWorldStorage()
Gets the associated
WorldStorage persisting this world. |
Optional<Chunk> |
loadChunk(int x,
int y,
int z,
boolean shouldGenerate)
Get the chunk at the given position if it exists or if
shouldGenerate is true and the chunk is generated. |
Optional<Chunk> |
loadChunk(com.flowpowered.math.vector.Vector3i position,
boolean shouldGenerate)
Get the chunk at the given position if it exists or if
shouldGenerate is true and the chunk is generated. |
void |
setKeepSpawnLoaded(boolean keepLoaded)
Sets whether this
World 's spawn chunks remain loaded when no
players are present. |
void |
setScoreboard(Scoreboard scoreboard)
Sets the
Scoreboard for this world. |
void |
setWorldGenerator(WorldGenerator generator)
Sets the
WorldGenerator for this world to use to create new
chunks. |
void |
triggerExplosion(Explosion explosion)
Causes an
Explosion in a world. |
boolean |
unloadChunk(Chunk chunk)
Unloads the given chunk from the world.
|
addScheduledUpdate, addScheduledUpdate, createSnapshot, createSnapshot, getExtentView, getExtentView, getRelativeExtentView, getScheduledUpdates, getScheduledUpdates, isLoaded, removeScheduledUpdate, removeScheduledUpdate, restoreSnapshot, restoreSnapshot, restoreSnapshot, setBlock, setBlock, setBlockType, setBlockType
createEntity, createEntity, createEntity, createEntity, getEntities, getEntities, restoreSnapshot, spawnEntity
getTileEntities, getTileEntities, getTileEntity, getTileEntity
getBlockView, getBlockView, getRelativeBlockView, setBlock, setBlock, setBlockType, setBlockType
containsBlock, containsBlock, getBlock, getBlock, getBlockCopy, getBlockCopy, getBlockMax, getBlockMin, getBlockSize, getBlockType, getBlockType, getImmutableBlockCopy, getUnmodifiableBlockView
getBiomeView, getBiomeView, getRelativeBiomeView, setBiome, setBiome
containsBiome, containsBiome, getBiome, getBiome, getBiomeCopy, getBiomeCopy, getBiomeMax, getBiomeMin, getBiomeSize, getImmutableBiomeCopy, getUnmodifiableBiomeView
copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, copyFrom, get, get, get, get, getKeys, getKeys, getManipulators, getManipulators, getOrCreate, getOrCreate, getOrElse, getOrElse, getOrNull, getOrNull, getValue, getValue, getValues, getValues, offer, offer, offer, offer, offer, offer, offer, offer, offer, offer, offer, remove, remove, remove, remove, setRawData, setRawData, supports, supports, supports, supports, supports, supports, supports, supports, transform, transform, undo, undo, validateRawData, validateRawData
getUniqueId
getProperties, getProperties, getProperty, getProperty, getProperty, getProperty
forecast, forecast, getRemainingDuration, getRunningDuration, getWeather
clearTitle, playSound, playSound, playSound, resetTitle, sendMessage, sendMessage, sendTitle, spawnParticles, spawnParticles
getContext
default Location<World> getLocation(com.flowpowered.math.vector.Vector3i position)
Extent
getLocation
in interface Extent
position
- The positiondefault Location<World> getLocation(int x, int y, int z)
Extent
getLocation
in interface Extent
x
- The X positiony
- The Y positionz
- The Z positiondefault Location<World> getLocation(com.flowpowered.math.vector.Vector3d position)
Extent
getLocation
in interface Extent
position
- The positiondefault Location<World> getLocation(double x, double y, double z)
Extent
getLocation
in interface Extent
x
- The X positiony
- The Y positionz
- The Z positionDifficulty getDifficulty()
Difficulty
setting for this world.String getName()
The world name may randomly generated or user-defined. It may or may not be safe to be used in a filename.
A method to get a unique identifier
Optional<Chunk> getChunk(com.flowpowered.math.vector.Vector3i position)
position
- The positionOptional<Chunk> getChunk(int x, int y, int z)
x
- The x coordinatey
- The y coordinatez
- The z coordinateOptional<Chunk> loadChunk(com.flowpowered.math.vector.Vector3i position, boolean shouldGenerate)
shouldGenerate
is true and the chunk is generated.position
- The positionshouldGenerate
- True to generate a new chunkOptional<Chunk> loadChunk(int x, int y, int z, boolean shouldGenerate)
shouldGenerate
is true and the chunk is generated.x
- The x coordinatey
- The y coordinatez
- The z coordinateshouldGenerate
- True to generate a new chunkboolean unloadChunk(Chunk chunk)
boolean
flag
for whether the operation was successful.chunk
- The chunk to unloadIterable<Chunk> getLoadedChunks()
The ordering of the returned chunks is undefined.
Optional<Entity> getEntity(UUID uuid)
UUID
matches the provided id, possibly
returning no entity if the entity is not loaded or non-existant.
For world implementations, only some parts of the world is usually loaded, so this method may return no entity if the entity is not loaded.
uuid
- The unique idWorldBorder getWorldBorder()
Optional<String> getGameRule(String gameRule)
gameRule
- The name of the GameRule.Map<String,String> getGameRules()
WorldGenerator getWorldGenerator()
WorldGenerator
for this world.
Any changes made to the world generator won't affect the world until
setWorldGenerator(WorldGenerator)
, and even then only newly
changed chunks will be affected.
void setWorldGenerator(WorldGenerator generator)
WorldGenerator
for this world to use to create new
chunks.generator
- The new generatorboolean doesKeepSpawnLoaded()
World
's spawn chunks remain loaded when no
players are present. Note: This method will default to this World
's DimensionType
's keepLoaded value unless a plugin overrides it.World
remains loaded without players, false if
notvoid setKeepSpawnLoaded(boolean keepLoaded)
World
's spawn chunks remain loaded when no
players are present. Note: This method will override the default
DimensionType
's keepLoaded value.keepLoaded
- Whether this World
's spawn chunks remain loaded
without playersWorldStorage getWorldStorage()
WorldStorage
persisting this world.Scoreboard getScoreboard()
Scoreboard
void setScoreboard(Scoreboard scoreboard)
Scoreboard
for this world.scoreboard
- The scoreboard to setWorldCreationSettings getCreationSettings()
WorldCreationSettings
which were used to create this
world.WorldProperties getProperties()
Location<World> getSpawnLocation()
Location
of the spawn point.void triggerExplosion(Explosion explosion)
Explosion
in a world.explosion
- The explosion to causeTeleporterAgent getTeleporterAgent()
PlayerSimulator getPlayerSimulator()