Class endstone::Dimension¶
ClassList > endstone > Dimension
Represents a dimension within a Level .
#include <endstone/level/dimension.h>
Inherits the following classes: std::enable_shared_from_this< Dimension >
Public Static Attributes¶
| Type | Name |
|---|---|
| constexpr auto | Nether = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("nether") |
| constexpr auto | Overworld = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("overworld") |
| constexpr auto | TheEnd = [**DimensionId::minecraft**](classendstone_1_1Identifier.md#function-minecraft)("the\_end") |
Public Functions¶
| Type | Name |
|---|---|
| virtual Item & | dropItem (Location location, const ItemStack & item) = 0 Drops an item at the specified Location . |
| virtual std::vector< Actor * > | getActors () const = 0 Get a list of all actors in this dimension. |
| virtual std::unique_ptr< Block > | getBlockAt (int x, int y, int z) const = 0 Gets the Block at the given coordinates. |
| virtual std::unique_ptr< Block > | getBlockAt (Location location) const = 0 Gets the Block at the givenLocation . |
| virtual std::unique_ptr< Block > | getHighestBlockAt (int x, int z) const = 0 Gets the highest non-empty (impassable) block at the given coordinates. |
| virtual std::unique_ptr< Block > | getHighestBlockAt (Location location) const = 0 Gets the highest non-empty (impassable) block at the given Location . |
| virtual int | getHighestBlockYAt (int x, int z) const = 0 Gets the highest non-empty (impassable) coordinate at the given coordinates. |
| virtual DimensionId | getId () const = 0 Return the identifier of this dimension. |
| virtual Level & | getLevel () const = 0 Gets the level to which this dimension belongs. |
| virtual std::vector< std::unique_ptr< Chunk > > | getLoadedChunks () = 0 Gets a list of all loaded Chunks. |
| virtual std::string | getTranslationKey () const = 0 Get the translation key, suitable for use in a translation component. |
| virtual bool | isChunkLoaded (int x, int z) const = 0 Checks if the Chunk at the given coordinates is loaded. |
| virtual bool | isValid () const = 0 Checks whether this dimension is still valid (loaded). |
| virtual bool | loadChunk (int x, int z) = 0 Requests the Chunk at the given coordinates to be loaded, and keeps it loaded until it is unloaded again. |
| virtual Actor * | spawnActor (Location location, ActorTypeId type) = 0 Creates an actor at the given Location . |
| virtual bool | unloadChunk (int x, int z) = 0 Releases the plugin-owned ticket that loadChunk() placed on theChunk at the given coordinates. |
| virtual | ~Dimension () = default |
Public Static Attributes Documentation¶
variable Nether¶
variable Overworld¶
variable TheEnd¶
Public Functions Documentation¶
function dropItem¶
Drops an item at the specified Location .
Parameters:
Returns:
Item entity created as a result of this method
function getActors¶
Get a list of all actors in this dimension.
Returns:
A List of all actors currently residing in this dimension
function getBlockAt [½]¶
Gets the Block at the given coordinates.
Parameters:
xX-coordinate of the blockyY-coordinate of the blockzZ-coordinate of the block
Returns:
Block at the given coordinates
function getBlockAt [2/2]¶
Gets the Block at the givenLocation .
Parameters:
locationLocation of the block
Returns:
Block at the given coordinates
function getHighestBlockAt [½]¶
Gets the highest non-empty (impassable) block at the given coordinates.
Parameters:
xX-coordinate of the blockzZ-coordinate of the block
Returns:
Highest non-empty block
function getHighestBlockAt [2/2]¶
Gets the highest non-empty (impassable) block at the given Location .
virtual std::unique_ptr< Block > endstone::Dimension::getHighestBlockAt (
Location location
) const = 0
Parameters:
locationCoordinates to get the highest block
Returns:
Highest non-empty block
function getHighestBlockYAt¶
Gets the highest non-empty (impassable) coordinate at the given coordinates.
Parameters:
xX-coordinate of the blockszZ-coordinate of the blocks
Returns:
Y-coordinate of the highest non-empty block
function getId¶
Return the identifier of this dimension.
Returns:
this dimension's identifier
function getLevel¶
Gets the level to which this dimension belongs.
Returns:
Level containing this dimension.
function getLoadedChunks¶
Gets a list of all loaded Chunks.
Returns:
All loaded chunks
function getTranslationKey¶
Get the translation key, suitable for use in a translation component.
Returns:
the translation key
function isChunkLoaded¶
Checks if the Chunk at the given coordinates is loaded.
Parameters:
xX-coordinate of the chunkzZ-coordinate of the chunk
Returns:
true if the chunk is loaded, otherwise false
function isValid¶
Checks whether this dimension is still valid (loaded).
A Dimension handle can outlive the underlying dimension if it is unloaded; this returns false once that happens, after which accessing the dimension throws.
Returns:
true if the dimension is still loaded, false otherwise
function loadChunk¶
Requests the Chunk at the given coordinates to be loaded, and keeps it loaded until it is unloaded again.
Unlike Java Edition, Bedrock has no synchronous chunk load: this registers a plugin-owned ticking ticket for the chunk, which is honoured on the next server tick (so the chunk may not be available within this call). The chunk is then kept loaded and ticking until removed with unloadChunk(), the server restarts, or the ticket limit is reached. Intended for keeping a handful of chunks resident; it is not suited to loading large regions.
Parameters:
xX-coordinate of the chunkzZ-coordinate of the chunk
Returns:
true if the ticket was registered (or already present), otherwise false
function spawnActor¶
Creates an actor at the given Location .
Parameters:
locationThe location to spawn the actortypeThe actor type to spawn
Returns:
Resulting Actor of this method
function unloadChunk¶
Releases the plugin-owned ticket that loadChunk() placed on theChunk at the given coordinates.
This only removes Endstone's own ticket; it never affects /tickingareas or other holders. The chunk is unloaded once nothing else keeps it loaded (a nearby player, the spawn area, etc.), so this is a no-op in effect while the chunk is still in use.
Parameters:
xX-coordinate of the chunkzZ-coordinate of the chunk
Returns:
true once the ticket has been released
function ~Dimension¶
The documentation for this class was generated from the following file include/endstone/level/dimension.h