Class RelativeLocation<T>
java.lang.Object
net.minestom.server.utils.location.RelativeLocation<T>
- Type Parameters:
T
- the location type
- Direct Known Subclasses:
RelativeBlockPosition
,RelativeVec
public abstract class RelativeLocation<T>
extends java.lang.Object
Represents a location which can have fields relative to an
Entity
position.-
Field Summary
-
Constructor Summary
Constructors Constructor Description RelativeLocation(T location, boolean relativeX, boolean relativeY, boolean relativeZ)
-
Method Summary
Modifier and Type Method Description abstract T
fromRelativePosition(Entity entity)
Gets the location based on the relative fields andentity
.boolean
isRelativeX()
Gets if the 'x' field is relative.boolean
isRelativeY()
Gets if the 'y' field is relative.boolean
isRelativeZ()
Gets if the 'z' field is relative.
-
Field Details
-
Constructor Details
-
RelativeLocation
public RelativeLocation(@NotNull T location, boolean relativeX, boolean relativeY, boolean relativeZ)
-
-
Method Details
-
fromRelativePosition
Gets the location based on the relative fields andentity
.- Parameters:
entity
- the entity to get the relative position from- Returns:
- the location
-
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
-