Package eu.sculkpowered.server.world
Interface World
public interface World
Represents a world.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
Represents a world builder. -
Method Summary
Modifier and TypeMethodDescription@NotNull BlockState
block
(int x, int y, int z) Gets the block at the specified coordinates.void
block
(int x, int y, int z, @NotNull BlockState block) Sets the specified block at the specified coordinates.default @NotNull BlockState
Gets the block at the specified position.default void
block
(@NotNull Position position, @NotNull BlockState block) Sets the specified block at the specified coordinates.static World.Builder
builder()
Creates a new world builder.@NotNull Chunk
chunk
(int chunkX, int chunkZ) Gets the chunk at the specified chunk coordinates.@NotNull Chunk
chunkAt
(int x, int z) Gets the chunk at the specified coordinates.@NotNull Chunk
Gets the chunk at the specified position.@NotNull GameMode
Gets the default game mode of the world.@NotNull Dimension
Gets the dimension of the world.@NotNull CompoundBinaryTag
Gets the extra world data.void
extraData
(@NotNull CompoundBinaryTag data) Sets the extra data.@NotNull ChunkGenerator
Gets the chunk generator of the world.boolean
isAlive()
Checks if the world is alive.@NotNull String
name()
Gets the name of the world.void
save
(@NotNull WorldSaver saver) Saves a world.void
spawnEntity
(@NotNull Entity entity, @NotNull Position position) Spawns the specified entity at the specified position in this world.@NotNull Position
Gets the spawn position of the world.
-
Method Details
-
name
Gets the name of the world.- Returns:
- the world's name
- Since:
- 1.0.0
-
dimension
Gets the dimension of the world.- Returns:
- the world's dimension
- Since:
- 1.0.0
-
generator
Gets the chunk generator of the world.- Returns:
- the world's chunk generator
- Since:
- 1.0.0
-
spawnPosition
Gets the spawn position of the world.- Returns:
- the world's spawn position
- Since:
- 1.0.0
-
defaultGameMode
Gets the default game mode of the world.- Returns:
- the world's default game mode
- Since:
- 1.0.0
-
block
Sets the specified block at the specified coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateblock
- the block to set- Since:
- 1.0.0
-
block
Sets the specified block at the specified coordinates.- Parameters:
position
- the positionblock
- the block to set- Since:
- 1.0.0
-
block
Gets the block at the specified coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate- Returns:
- the block at the specified coordinates
- Since:
- 1.0.0
-
block
Gets the block at the specified position.- Parameters:
position
- the position of the block- Returns:
- the block at the specified position
- Since:
- 1.0.0
-
chunk
Gets the chunk at the specified chunk coordinates.- Parameters:
chunkX
- the chunk x coordinatechunkZ
- the chunk z coordinate- Returns:
- the chunk at the specified chunk coordinates
- Since:
- 1.0.0
-
chunkAt
Gets the chunk at the specified coordinates.- Parameters:
x
- the x coordinatez
- the z coordinate- Returns:
- the chunk at the specified coordinates
- Since:
- 1.0.0
-
chunkAt
Gets the chunk at the specified position.- Parameters:
position
- the position- Returns:
- the chunk at the specified position
- Since:
- 1.0.0
-
spawnEntity
Spawns the specified entity at the specified position in this world.- Parameters:
entity
- the entity to spawnposition
- the position- Since:
- 1.0.0
-
extraData
Gets the extra world data. In the anvil folder it is the level dat file.- Since:
- 1.0.0
-
extraData
Sets the extra data.- Parameters:
data
- the data in a compound binary tag- Since:
- 1.0.0
-
isAlive
boolean isAlive()Checks if the world is alive.- Returns:
- whether the world is alive
- Since:
- 1.0.0
-
save
Saves a world.- Since:
- 1.0.0
-
builder
Creates a new world builder.- Returns:
- a new builder instance.
- Since:
- 1.0.0
-