The Level
class represents a world/map that is loaded into memory
General guidelines:
- Keep in mind that some methods update level state without broadcasting the changes to the players currently in the level, while other methods will both update the level state and also broadcast the changes to players
The width of this level (Number of blocks across in X dimension)
The height of this level (Number of blocks tall in Y dimension)
The length of this level (Number of blocks across in Z dimension)
Converts the given x,y,z coordinates to a coordinates index
Remarks:
- Returns -1 if coordinates outside this level's boundaries are given
Converts the given coordinates index to x,y,z coordinates
Remarks:
- Undefined behaviour if given coordinates index is invalid
Whether the given coordinates lie within this level's boundaries
Gets the block at the given coordinates index
Remarks:
- Undefined behaviour if the coordinates are outside the level boundaries
Gets the block at the given x,y,z coordinates
Remarks:
- Undefined behaviour if the coordinates are outside the level boundaries
Gets the block at the given x,y,z coordinates
Remarks:
- Returns
Block.Invalid
if the coordinates are outside the level boundaries
Gets the block at the given x,y,z coordinates, and additionally returns the corresponding coordinates index
Remarks:
- Returns
Block.Invalid
if the coordinates are outside the level boundaries
Sets the block at the given x,y,z coordinates
Remarks:
- Does nothing if the coordinates are outside the level boundaries