Skip to content

Class endstone::Dimension

ClassList > endstone > Dimension

Represents a dimension within a Level .

  • #include <endstone/level/dimension.h>

Public Static Attributes

Type Name
constexpr auto Nether = DimensionId::minecraft("nether")
constexpr auto Overworld = DimensionId::minecraft("overworld")
constexpr auto TheEnd = DimensionId::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 Actor * spawnActor (Location location, ActorTypeId type) = 0
Creates an actor at the given Location .
virtual ~Dimension () = default

Public Static Attributes Documentation

variable Nether

constexpr auto endstone::Dimension::Nether;

variable Overworld

constexpr auto endstone::Dimension::Overworld;

variable TheEnd

constexpr auto endstone::Dimension::TheEnd;

Public Functions Documentation

function dropItem

Drops an item at the specified Location .

virtual Item & endstone::Dimension::dropItem (
    Location location,
    const  ItemStack & item
) = 0

Parameters:

Returns:

Item entity created as a result of this method


function getActors

Get a list of all actors in this dimension.

virtual std::vector< Actor * > endstone::Dimension::getActors () const = 0

Returns:

A List of all actors currently residing in this dimension


function getBlockAt [½]

Gets the Block at the given coordinates.

virtual std::unique_ptr< Block > endstone::Dimension::getBlockAt (
    int x,
    int y,
    int z
) const = 0

Parameters:

  • x X-coordinate of the block
  • y Y-coordinate of the block
  • z Z-coordinate of the block

Returns:

Block at the given coordinates


function getBlockAt [2/2]

Gets the Block at the givenLocation .

virtual std::unique_ptr< Block > endstone::Dimension::getBlockAt (
    Location location
) const = 0

Parameters:

Returns:

Block at the given coordinates


function getHighestBlockAt [½]

Gets the highest non-empty (impassable) block at the given coordinates.

virtual std::unique_ptr< Block > endstone::Dimension::getHighestBlockAt (
    int x,
    int z
) const = 0

Parameters:

  • x X-coordinate of the block
  • z Z-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:

  • location Coordinates to get the highest block

Returns:

Highest non-empty block


function getHighestBlockYAt

Gets the highest non-empty (impassable) coordinate at the given coordinates.

virtual int endstone::Dimension::getHighestBlockYAt (
    int x,
    int z
) const = 0

Parameters:

  • x X-coordinate of the blocks
  • z Z-coordinate of the blocks

Returns:

Y-coordinate of the highest non-empty block


function getId

Return the identifier of this dimension.

virtual DimensionId endstone::Dimension::getId () const = 0

Returns:

this dimension's identifier


function getLevel

Gets the level to which this dimension belongs.

virtual Level & endstone::Dimension::getLevel () const = 0

Returns:

Level containing this dimension.


function getLoadedChunks

Gets a list of all loaded Chunks.

virtual std::vector< std::unique_ptr< Chunk > > endstone::Dimension::getLoadedChunks () = 0

Returns:

All loaded chunks


function getTranslationKey

Get the translation key, suitable for use in a translation component.

virtual std::string endstone::Dimension::getTranslationKey () const = 0

Returns:

the translation key


function spawnActor

Creates an actor at the given Location .

virtual Actor * endstone::Dimension::spawnActor (
    Location location,
    ActorTypeId type
) = 0

Parameters:

  • location The location to spawn the actor
  • type The actor type to spawn

Returns:

Resulting Actor of this method


function ~Dimension

virtual endstone::Dimension::~Dimension () = default


The documentation for this class was generated from the following file include/endstone/level/dimension.h