Record Class BlockOrEntityRaycastResult
java.lang.Object
java.lang.Record
com.zenith.feature.player.raycast.BlockOrEntityRaycastResult
public record BlockOrEntityRaycastResult(boolean hit, @Nullable BlockRaycastResult block, @Nullable EntityRaycastResult entity)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionBlockOrEntityRaycastResult(boolean hit, @Nullable BlockRaycastResult block, @Nullable EntityRaycastResult entity) Creates an instance of aBlockOrEntityRaycastResultrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable BlockRaycastResultblock()Returns the value of theblockrecord component.@Nullable EntityRaycastResultentity()Returns the value of theentityrecord component.final 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.booleanisBlock()booleanisEntity()static BlockOrEntityRaycastResultmiss()final StringtoString()Returns a string representation of this record class.static BlockOrEntityRaycastResultwrap(BlockRaycastResult blockRaycastResult) static BlockOrEntityRaycastResultwrap(EntityRaycastResult entityRaycastResult)
-
Constructor Details
-
BlockOrEntityRaycastResult
public BlockOrEntityRaycastResult(boolean hit, @Nullable BlockRaycastResult block, @Nullable EntityRaycastResult entity) Creates an instance of aBlockOrEntityRaycastResultrecord class.- Parameters:
hit- the value for thehitrecord componentblock- the value for theblockrecord componententity- the value for theentityrecord component
-
-
Method Details
-
miss
-
wrap
-
wrap
-
isEntity
public boolean isEntity() -
isBlock
public boolean isBlock() -
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
-
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
entity
Returns the value of theentityrecord component.- Returns:
- the value of the
entityrecord component
-