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.
      face - The face to test
    • intersectBox

      boolean intersectBox(@NotNull @NotNull Point positionRelative, @NotNull @NotNull BoundingBox boundingBox)
      Checks if two bounding boxes intersect.
      positionRelative - Relative position of bounding box to check with
      boundingBox - Bounding box to check for intersections with
      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.
      rayStart - Position of the moving shape
      rayDirection - Movement vector
      shapePos - Position of this shape
      moving - Bounding Box of moving shape
      finalResult - Stores final SweepResult
      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.
      entity - the entity to check the bounding box
      true if this bounding box intersects with the entity, false otherwise
    • relativeStart

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

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