Package dev.cerus.maps.raycast
Record Class RayCaster.Result<O>
java.lang.Object
java.lang.Record
dev.cerus.maps.raycast.RayCaster.Result<O>
- Type Parameters:
O- The type of the obstruction- Record Components:
lengthTravelled- The total length that the ray has travelledlength- The length that the ray was supposed to travelpoints- The individual points of the ray caststoppedAt- The point where the ray has stopped athitObstruction- The obstruction that the ray has hitforceStop- Whether the ray was forced to stop by an obstruction or not
- Enclosing class:
- RayCaster
public static record RayCaster.Result<O>(double lengthTravelled, double length, List<org.bukkit.Location> points, org.bukkit.Location stoppedAt, O hitObstruction, boolean forceStop)
extends Record
Result of a ray cast operation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theforceStoprecord component.inthashCode()Returns a hash code value for this object.Returns the value of thehitObstructionrecord component.doublelength()Returns the value of thelengthrecord component.doubleReturns the value of thelengthTravelledrecord component.List<org.bukkit.Location>points()Returns the value of thepointsrecord component.org.bukkit.LocationReturns the value of thestoppedAtrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Result
public Result(double lengthTravelled, double length, List<org.bukkit.Location> points, org.bukkit.Location stoppedAt, O hitObstruction, boolean forceStop)Creates an instance of aResultrecord class.- Parameters:
lengthTravelled- the value for thelengthTravelledrecord componentlength- the value for thelengthrecord componentpoints- the value for thepointsrecord componentstoppedAt- the value for thestoppedAtrecord componenthitObstruction- the value for thehitObstructionrecord componentforceStop- the value for theforceStoprecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
lengthTravelled
public double lengthTravelled()Returns the value of thelengthTravelledrecord component.- Returns:
- the value of the
lengthTravelledrecord component
-
length
public double length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
points
Returns the value of thepointsrecord component.- Returns:
- the value of the
pointsrecord component
-
stoppedAt
public org.bukkit.Location stoppedAt()Returns the value of thestoppedAtrecord component.- Returns:
- the value of the
stoppedAtrecord component
-
hitObstruction
Returns the value of thehitObstructionrecord component.- Returns:
- the value of the
hitObstructionrecord component
-
forceStop
public boolean forceStop()Returns the value of theforceStoprecord component.- Returns:
- the value of the
forceStoprecord component
-