Interface Shape

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

@Experimental public interface Shape
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    intersectBox(@NotNull net.minestom.server.coordinate.Point positionRelative, @NotNull BoundingBox boundingBox)
    Checks if two bounding boxes intersect.
    boolean
    intersectBoxSwept(@NotNull net.minestom.server.coordinate.Point rayStart, @NotNull net.minestom.server.coordinate.Point rayDirection, @NotNull net.minestom.server.coordinate.Point shapePos, @NotNull BoundingBox moving, @NotNull SweepResult finalResult)
    Checks if a moving bounding box will hit this shape.
    default boolean
    intersectEntity(@NotNull net.minestom.server.coordinate.Point src, @NotNull Entity entity)
    Used to know if this BoundingBox intersects with the bounding box of an entity.
    default boolean
    isFaceFull(@NotNull net.minestom.server.instance.block.BlockFace face)
    Returns true if the given block face is completely covered by this shape, false otherwise.
    boolean
    isOccluded(@NotNull Shape shape, @NotNull net.minestom.server.instance.block.BlockFace face)
     
    @NotNull net.minestom.server.coordinate.Point
    Relative End
    @NotNull net.minestom.server.coordinate.Point
    Relative Start
  • Method Details

    • isOccluded

      boolean isOccluded(@NotNull @NotNull Shape shape, @NotNull @NotNull net.minestom.server.instance.block.BlockFace face)
    • isFaceFull

      default boolean isFaceFull(@NotNull @NotNull net.minestom.server.instance.block.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 net.minestom.server.coordinate.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 net.minestom.server.coordinate.Point rayStart, @NotNull @NotNull net.minestom.server.coordinate.Point rayDirection, @NotNull @NotNull net.minestom.server.coordinate.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 net.minestom.server.coordinate.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 net.minestom.server.coordinate.Point relativeStart()
      Relative Start
      Returns:
      Start of shape
    • relativeEnd

      @NotNull @NotNull net.minestom.server.coordinate.Point relativeEnd()
      Relative End
      Returns:
      End of shape