Class RayTraceResult

java.lang.Object
wtf.choco.veinminer.platform.world.RayTraceResult

public final class RayTraceResult extends Object
The result of a ray trace.
See Also:
  • Constructor Details

    • RayTraceResult

      public RayTraceResult(@Nullable @Nullable BlockPosition hitBlock, @Nullable @Nullable BlockFace hitBlockFace)
      Construct a new RayTraceResult.
      Parameters:
      hitBlock - the block position that was hit
      hitBlockFace - the face on which the ray trace landed
    • RayTraceResult

      public RayTraceResult()
      Construct an empty RayTraceResult.
  • Method Details

    • isHit

      public boolean isHit()
      Check whether or not there was a successful hit.
      Returns:
      true if hit, false if all values in this result are null
    • getHitBlock

      @Nullable public @Nullable BlockPosition getHitBlock()
      Get the BlockPosition that was hit in this result, or null if this result does not represent a hit.
      Returns:
      the hit block, or null
    • getHitBlockFace

      @Nullable public @Nullable BlockFace getHitBlockFace()
      Get the BlockFace that was hit in this result, or null if this result does not represent a hit.
      Returns:
      the hit block face, or null