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
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRelativeVec(@NotNull Vec vec, @NotNull RelativeVec.CoordinateType coordinateType, boolean relativeX, boolean relativeY, boolean relativeZ) -
Method Summary
Modifier and TypeMethodDescription@NotNull RelativeVec.CoordinateTypeboolean@NotNull VecGets the location based on the relative fields andposition.@NotNull VecGets the location based on the relative fields andentity.@NotNull VecfromSender(@Nullable CommandSender sender) @NotNull VecinthashCode()booleanGets if the 'x' field is relative.booleanGets if the 'y' field is relative.booleanGets 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()
-