Class endstone::Level¶
Represents a level, which may contain actors, chunks and blocks.
#include <endstone/level/level.h>
Public Functions¶
| Type | Name |
|---|---|
| virtual GameRuleValue | _getGameRule (Identifier< GameRule > rule) const = 0 Gets the value of a game rule. |
| virtual bool | _hasGameRule (Identifier< GameRule > rule) const = 0 Checks if a game rule exists. |
| virtual bool | _setGameRule (Identifier< GameRule > rule, GameRuleValue value) = 0 Sets the value of a game rule. |
| virtual Nullable< Dimension > | createDimension (const DimensionCreator & creator) = 0 Creates a new custom dimension within this level. |
| virtual std::vector< NotNull< Actor > > | getActors () const = 0 Get a list of all actors in this level. |
| virtual Nullable< Dimension > | getDimension (DimensionId id) const = 0 Gets the dimension with the given id. |
| virtual std::vector< NotNull< Dimension > > | getDimensions () const = 0 Gets a list of all dimensions within this level. |
| T | getGameRule (GameRuleId< T > rule) const Gets the value of a game rule. |
| virtual std::string | getName () const = 0 Gets the unique name of this level. |
| virtual std::vector< NotNull< Recipe > > | getRecipes () const = 0 Get the list of crafting recipes. |
| virtual std::int64_t | getSeed () const = 0 Gets the Seed for this level. |
| virtual int | getTime () const = 0 Gets the relative in-game time of this level. |
| bool | hasGameRule (GameRuleId< T > rule) const Checks if a game rule exists. |
| bool | setGameRule (GameRuleId< T > rule, T value) Sets the value of a game rule. |
| virtual void | setTime (int time) = 0 Sets the relative in-game time on the server. |
| virtual | ~Level () = default |
Public Functions Documentation¶
function _getGameRule¶
Gets the value of a game rule.
Parameters:
ruleThe Minecraft game rule to get
Returns:
The current game rule value
function _hasGameRule¶
Checks if a game rule exists.
Parameters:
ruleThe Minecraft game rule to check
Returns:
True if the game rule exists
function _setGameRule¶
Sets the value of a game rule.
virtual bool endstone::Level::_setGameRule (
Identifier < GameRule > rule,
GameRuleValue value
) = 0
Parameters:
ruleThe Minecraft game rule to setvalueThe new value
Returns:
True if the value was accepted
function createDimension¶
Creates a new custom dimension within this level.
virtual Nullable < Dimension > endstone::Level::createDimension (
const DimensionCreator & creator
) = 0
The dimension is created from the options described by the given DimensionCreator. Custom dimensions are empty (void) dimensions identified by a namespaced id, e.g. myplugin:void_realm; populate them with blocks, structures or actors afterward.
The level remembers which id belongs to which name, so a dimension's terrain and actors survive a restart. The registration itself does not: call this again on every startup to get the same dimension back.
If a dimension with the requested name already exists, that existing dimension is returned instead.
Parameters:
creatorthe options to use when creating the dimension
Returns:
the newly created (or existing) Dimension, or null if it could not be created
function getActors¶
Get a list of all actors in this level.
Returns:
A List of all actors currently residing in this level
function getDimension¶
Gets the dimension with the given id.
Parameters:
idthe id of the dimension to retrieve.
Returns:
The Dimension with the given id, or null if none exists
function getDimensions¶
Gets a list of all dimensions within this level.
Returns:
a list of dimensions
function getGameRule¶
Gets the value of a game rule.
Template parameters:
TThe type of the game rule's value.
Parameters:
ruleThe Minecraft game rule to get
Returns:
The current game rule value
function getName¶
Gets the unique name of this level.
Returns:
Name of this level
function getRecipes¶
Get the list of crafting recipes.
Returns:
a list of recipes
function getSeed¶
Gets the Seed for this level.
Returns:
This level's Seed
function getTime¶
Gets the relative in-game time of this level.
Returns:
The current relative time
function hasGameRule¶
Checks if a game rule exists.
Template parameters:
TThe type of the game rule's value.
Parameters:
ruleThe Minecraft game rule to check
Returns:
True if the game rule exists
function setGameRule¶
Sets the value of a game rule.
Template parameters:
TThe type of the game rule's value.
Parameters:
ruleThe Minecraft game rule to setvalueThe new value
Returns:
True if the value was accepted
function setTime¶
Sets the relative in-game time on the server.
Parameters:
timeThe new relative time to set the in-game time to
function ~Level¶
The documentation for this class was generated from the following file include/endstone/level/level.h