Class RelativeVec
java.lang.Object
net.minestom.server.utils.location.RelativeVec
Represents a location which can have fields relative to an
Entity
position.-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRelativeVec
(@NotNull Vec vec, @NotNull RelativeVec.CoordinateType coordinateType, boolean relativeX, boolean relativeY, boolean relativeZ) -
Method Summary
Modifier and TypeMethodDescription@NotNull RelativeVec.CoordinateType
boolean
@NotNull Vec
Gets the location based on the relative fields andposition
.@NotNull Vec
Gets the location based on the relative fields andentity
.@NotNull Vec
fromSender
(@Nullable CommandSender sender) @NotNull Vec
int
hashCode()
boolean
Gets if the 'x' field is relative.boolean
Gets if the 'y' field is relative.boolean
Gets if the 'z' field is relative.
-
Constructor Details
-
RelativeVec
public RelativeVec(@NotNull @NotNull Vec vec, @NotNull @NotNull RelativeVec.CoordinateType coordinateType, boolean relativeX, boolean relativeY, boolean relativeZ)
-
-
Method Details
-
coordinateType
-
from
Gets the location based on the relative fields andposition
.- Parameters:
origin
- the origin position, null if none- Returns:
- the location
-
fromView
-
from
Gets the location based on the relative fields andentity
.- Parameters:
entity
- the entity to get the relative position from- Returns:
- the location
-
fromSender
-
fromView
-
isRelativeX
public boolean isRelativeX()Gets if the 'x' field is relative.- Returns:
- true if the 'x' field is relative
-
isRelativeY
public boolean isRelativeY()Gets if the 'y' field is relative.- Returns:
- true if the 'y' field is relative
-
isRelativeZ
public boolean isRelativeZ()Gets if the 'z' field is relative.- Returns:
- true if the 'z' field is relative
-
equals
-
hashCode
public int hashCode()
-