Class Button.DetectableArea

java.lang.Object
com.marcusslover.plus.lib.item.Button.DetectableArea
All Implemented Interfaces:
IRegion
Enclosing class:
Button

public static class Button.DetectableArea extends Object implements IRegion
Represents a detectable area of a button. This is used to detect if a player clicked on a button.
  • Constructor Details

    • DetectableArea

      public DetectableArea(@NotNull @NotNull org.bukkit.util.Vector min, @NotNull @NotNull org.bukkit.util.Vector max)
      Creates a new detectable area with the given vectors.
      Parameters:
      min - The minimum vector
      max - The maximum vector
    • DetectableArea

      public DetectableArea(int x, int y)
      Creates a new detectable area with the given coordinates.
      Parameters:
      x - The x coordinate
      y - The y coordinate
  • Method Details

    • of

      @NotNull public static @NotNull Button.DetectableArea of(@NotNull @NotNull org.bukkit.util.Vector min, @NotNull @NotNull org.bukkit.util.Vector max)
    • of

      @NotNull public static @NotNull Button.DetectableArea of(int x, int y)
    • min

      @NotNull public @NotNull org.bukkit.util.Vector min()
      Gets the minimum vector.
      Specified by:
      min in interface IRegion
      Returns:
      The minimum vector
    • max

      @NotNull public @NotNull org.bukkit.util.Vector max()
      Gets the maximum vector.
      Specified by:
      max in interface IRegion
      Returns:
      The maximum vector
    • within

      public boolean within(@NotNull @NotNull org.bukkit.util.Vector vector, @NotNull @NotNull IRegion.DefaultVectorStrategy strategy)
      Checks if the given vector is within the region.
      Specified by:
      within in interface IRegion
      Parameters:
      vector - The vector
      strategy - The strategy
      Returns:
      True if the vector is within the region
    • singular

      public boolean singular()
      Check if the matrix is a single point.
      Returns:
      true if the matrix is a single point.
    • slots

      @NotNull public @NotNull Set<Integer> slots()
      Gets the slots of the button.
      Returns:
      The slots