Interface IRegion

All Known Implementing Classes:
Button.DetectableArea, Region

public interface IRegion
Represents a 2d region with two points.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    All default strategies for the vector check.
    static interface 
    Represents a vector strategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    default double
    Gets the maximum x value of the region.
    default double
    Gets the maximum y value of the region.
    default double
    Gets the maximum z value of the region.
    default double
    Gets the minimum x value of the region.
    default double
    Gets the minimum y value of the region.
    default double
    Gets the minimum z value of the region.
    @NotNull org.bukkit.util.Vector
    max()
    Gets the maximum point of the region.
    @NotNull org.bukkit.util.Vector
    min()
    Gets the minimum point of the region.
    default boolean
    within(@NotNull org.bukkit.Location location)
    Check if the given location is within the region.
    default boolean
    within(@NotNull org.bukkit.Location location, boolean excludeY)
    Check if the given location is within the region.
    default boolean
    within(@NotNull org.bukkit.entity.Entity entity)
    Check if the given entity is within the region.
    default boolean
    within(@NotNull org.bukkit.entity.Entity entity, boolean excludeY)
    Check if the given entity is within the region.
    default boolean
    within(@NotNull org.bukkit.util.Vector vector)
    Check if the given vector is within the region.
    default boolean
    within(@NotNull org.bukkit.util.Vector vector, boolean excludeY)
    Check if the given vector is within the region.
    default boolean
    within(@NotNull org.bukkit.util.Vector vector, @NotNull IRegion.DefaultVectorStrategy strategy)
    Check if the given vector is within the region.
    default boolean
    within(@NotNull org.bukkit.util.Vector vector, @NotNull org.bukkit.util.Vector min, @NotNull org.bukkit.util.Vector max, @NotNull IRegion.DefaultVectorStrategy strategy)
    Check if the given vector is within the region.
  • Method Details

    • min

      @NotNull @NotNull org.bukkit.util.Vector min()
      Gets the minimum point of the region.
      Returns:
      The minimum point of the region.
    • max

      @NotNull @NotNull org.bukkit.util.Vector max()
      Gets the maximum point of the region.
      Returns:
      The maximum point of the region.
    • getMinX

      default double getMinX()
      Gets the minimum x value of the region.
      Returns:
      The minimum x value of the region.
    • getMinY

      default double getMinY()
      Gets the minimum y value of the region.
      Returns:
      The minimum y value of the region.
    • getMinZ

      default double getMinZ()
      Gets the minimum z value of the region.
      Returns:
      The minimum z value of the region.
    • getMaxX

      default double getMaxX()
      Gets the maximum x value of the region.
      Returns:
      The maximum x value of the region.
    • getMaxY

      default double getMaxY()
      Gets the maximum y value of the region.
      Returns:
      The maximum y value of the region.
    • getMaxZ

      default double getMaxZ()
      Gets the maximum z value of the region.
      Returns:
      The maximum z value of the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Check if the given entity is within the region.
      Parameters:
      entity - The entity to check.
      Returns:
      True if the entity is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.entity.Entity entity, boolean excludeY)
      Check if the given entity is within the region. Add the excludeY parameter to exclude the y-axis check.
      Parameters:
      entity - The entity to check.
      excludeY - Exclude the y-axis check.
      Returns:
      True if the entity is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.util.Vector vector)
      Check if the given vector is within the region.
      Parameters:
      vector - The vector to check.
      Returns:
      True if the vector is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.util.Vector vector, boolean excludeY)
      Check if the given vector is within the region. Add the excludeY parameter to exclude the y-axis check.
      Parameters:
      vector - The vector to check.
      excludeY - Exclude the y-axis check.
      Returns:
      True if the vector is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.Location location)
      Check if the given location is within the region.
      Parameters:
      location - The location to check.
      Returns:
      True if the location is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.Location location, boolean excludeY)
      Check if the given location is within the region. Add the excludeY parameter to exclude the y-axis check.
      Parameters:
      location - The location to check.
      excludeY - Exclude the y-axis check.
      Returns:
      True if the location is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.util.Vector vector, @NotNull @NotNull IRegion.DefaultVectorStrategy strategy)
      Check if the given vector is within the region. Add the strategy parameter to customize the check more briefly.
      Parameters:
      vector - The vector to check.
      strategy - The strategy to use.
      Returns:
      True if the vector is within the region.
    • within

      default boolean within(@NotNull @NotNull org.bukkit.util.Vector vector, @NotNull @NotNull org.bukkit.util.Vector min, @NotNull @NotNull org.bukkit.util.Vector max, @NotNull @NotNull IRegion.DefaultVectorStrategy strategy)
      Check if the given vector is within the region. Add the strategy parameter to customize the check more briefly.
      Parameters:
      vector - The vector to check.
      min - The minimum vector.
      max - The maximum vector.
      strategy - The strategy to use.
      Returns:
      True if the vector is within the region.