CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.wrappers.Location2D Class Reference

A class that represents a Location in the x and z directions. More...

+ Inheritance diagram for dev.jorel.commandapi.wrappers.Location2D:

Classes

class  Location2DException
 An exception caused when accessing or setting the y-coordinate of a Location2D.
 

Public Member Functions

 Location2D (World world, double x, double y, double z, float yaw, float pitch)
 Constructs a Location2D location. More...
 
 Location2D (World world, double x, double y, double z)
 Constructs a Location2D location. More...
 
 Location2D (World world, double x, double z)
 Constructs a Location2D location. More...
 
double getY ()
 
int getBlockY ()
 
void setY (double y)
 Throws a Location2DException. More...
 

Detailed Description

A class that represents a Location in the x and z directions.

This class extends Location, so can be used anywhere a regular Location could be used.

Constructor & Destructor Documentation

◆ Location2D() [1/3]

dev.jorel.commandapi.wrappers.Location2D.Location2D ( World  world,
double  x,
double  y,
double  z,
float  yaw,
float  pitch 
)

Constructs a Location2D location.

Parameters
worldthe world in which this location resides
xthe x-coordinate of this location
ythe y-coordinate of this location
zthe z-coordinate of this location
yawthe absolute rotation on the x-plane, in degrees
pitchthe absolute rotation on the y-plane, in degrees

◆ Location2D() [2/3]

dev.jorel.commandapi.wrappers.Location2D.Location2D ( World  world,
double  x,
double  y,
double  z 
)

Constructs a Location2D location.

Parameters
worldthe world in which this location resides
xthe x-coordinate of this location
ythe y-coordinate of this location
zthe z-coordinate of this location

◆ Location2D() [3/3]

dev.jorel.commandapi.wrappers.Location2D.Location2D ( World  world,
double  x,
double  z 
)

Constructs a Location2D location.

Parameters
worldthe world in which this location resides
xthe x-coordinate of this location
zthe z-coordinate of this location

Member Function Documentation

◆ getBlockY()

int dev.jorel.commandapi.wrappers.Location2D.getBlockY ( )
Returns
A Location2DException

◆ getY()

double dev.jorel.commandapi.wrappers.Location2D.getY ( )
Returns
A Location2DException

◆ setY()

void dev.jorel.commandapi.wrappers.Location2D.setY ( double  y)

Throws a Location2DException.

Parameters
yy-coordinate