Record Class BlockRaycastResult
java.lang.Object
java.lang.Record
com.zenith.feature.player.raycast.BlockRaycastResult
public record BlockRaycastResult(boolean hit, int x, int y, int z, @Nullable RayIntersection intersection, Block block)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionBlockRaycastResult(boolean hit, int x, int y, int z, @Nullable RayIntersection intersection, Block block) Creates an instance of aBlockRaycastResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.@NonNull Directionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhit()Returns the value of thehitrecord component.@Nullable RayIntersectionReturns the value of theintersectionrecord component.static BlockRaycastResultmiss()final StringtoString()Returns a string representation of this record class.intx()Returns the value of thexrecord component.inty()Returns the value of theyrecord component.intz()Returns the value of thezrecord component.
-
Constructor Details
-
BlockRaycastResult
public BlockRaycastResult(boolean hit, int x, int y, int z, @Nullable RayIntersection intersection, Block block) Creates an instance of aBlockRaycastResultrecord class.- Parameters:
hit- the value for thehitrecord componentx- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord componentintersection- the value for theintersectionrecord componentblock- the value for theblockrecord component
-
-
Method Details
-
miss
-
direction
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
hit
public boolean hit()Returns the value of thehitrecord component.- Returns:
- the value of the
hitrecord component
-
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public int y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
intersection
Returns the value of theintersectionrecord component.- Returns:
- the value of the
intersectionrecord component
-
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-