Interface Shape

All Known Implementing Classes:
BoundingBox, Entity, EntityCreature, EntityProjectile, ExperienceOrb, ItemEntity, LivingEntity, Player, PlayerProjectile, ShapeImpl

@Experimental public interface Shape
  • Method Details

    • isOccluded

      boolean isOccluded(@NotNull @NotNull Shape shape, @NotNull @NotNull BlockFace face)
    • isFaceFull

      default boolean isFaceFull(@NotNull @NotNull BlockFace face)
      Returns true if the given block face is completely covered by this shape, false otherwise.
      Parameters:
      face - The face to test
    • intersectBox

      boolean intersectBox(@NotNull @NotNull Point positionRelative, @NotNull @NotNull BoundingBox boundingBox)
      Checks if two bounding boxes intersect.
      Parameters:
      positionRelative - Relative position of bounding box to check with
      boundingBox - Bounding box to check for intersections with
      Returns:
      is an intersection found
    • intersectBoxSwept

      boolean intersectBoxSwept(@NotNull @NotNull Point rayStart, @NotNull @NotNull Point rayDirection, @NotNull @NotNull Point shapePos, @NotNull @NotNull BoundingBox moving, @NotNull @NotNull SweepResult finalResult)
      Checks if a moving bounding box will hit this shape.
      Parameters:
      rayStart - Position of the moving shape
      rayDirection - Movement vector
      shapePos - Position of this shape
      moving - Bounding Box of moving shape
      finalResult - Stores final SweepResult
      Returns:
      is an intersection found
    • intersectEntity

      @Experimental default boolean intersectEntity(@NotNull @NotNull Point src, @NotNull @NotNull Entity entity)
      Used to know if this BoundingBox intersects with the bounding box of an entity.
      Parameters:
      entity - the entity to check the bounding box
      Returns:
      true if this bounding box intersects with the entity, false otherwise
    • relativeStart

      @NotNull @NotNull Point relativeStart()
      Relative Start
      Returns:
      Start of shape
    • relativeEnd

      @NotNull @NotNull Point relativeEnd()
      Relative End
      Returns:
      End of shape