Class Block
Defined in File Block.h
Inheritance Relationships
Derived Type
public Door
(Class Door)
Class Documentation
-
class Block
This file defines the members and methods implemented as part of the Block class.
This class represents a Minecraft block.
Subclassed by Door
Public Functions
-
std::string getMaterial()
Get the material of the block.
- Returns:
string The block’s material.
-
int getX()
Get the X coordinate of the block.
- Returns:
int The x coordinate.
-
int getY()
Get the Y coordinate of the block.
- Returns:
int The y coordinate.
-
int getZ()
Get the Z coordinate of the block.
- Returns:
int The z coordinate.
-
Pos &getPos()
Get the Pos object representation of the coordinates of the block.
- Returns:
Pos& The pos representation.
-
void setX(int x)
Set the x value of this object.
- Parameters:
x – The value to set to.
-
void setY(int y)
Set the y value of this object.
- Parameters:
y – The value to set to.
-
void setZ(int z)
Set the z value of this object.
- Parameters:
z – The value to set to.
-
void shiftX(int shift)
Shift the x value by a given amount.
- Parameters:
shift – The amount to shift by which may be positive or negative
-
void shiftY(int shift)
Shift the y value by a given amount.
- Parameters:
shift – The amount to shift by which may be positive or negative
-
void shiftZ(int shift)
Shift the z value by a given amount.
- Parameters:
shift – The amount to shift by which may be positive or negative
-
void shift(int shiftX, int shiftY, int shiftZ)
Shift the x,y and z values by given amounts.
- Parameters:
shiftX – The amount to shift x by which may be positive or negative
shiftY – The amount to shift x by which may be positive or negative
shiftZ – The amount to shift x by which may be positive or negative
-
virtual void toSemanticMapJSON(nlohmann::json &json_base)
Adds the JSON representation of this object to the “locations” list of the base json.
- Returns:
nlohmann::json The base json.
-
virtual void toLowLevelMapJSON(nlohmann::json &json_base)
Adds the alternate JSON representation of this object to the “blocks” list of the base json.
- Returns:
nlohmann::json The base json.
-
std::string getMaterial()