Interface Shape

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

public interface Shape
  • Method Details

    • isOccluded

      boolean isOccluded(Shape shape, BlockFace face)
    • isFaceFull

      default boolean isFaceFull(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(Point positionRelative, 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(Point rayStart, Point rayDirection, Point shapePos, BoundingBox moving, 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

      default boolean intersectEntity(Point src, 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

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

      Point relativeEnd()
      Relative End
      Returns:
      End of shape