Package com.marcusslover.plus.lib.item
Class Button.DetectableArea
java.lang.Object
com.marcusslover.plus.lib.item.Button.DetectableArea
- All Implemented Interfaces:
IRegion
- Enclosing class:
Button
Represents a detectable area of a button.
This is used to detect if a player clicked on a button.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.marcusslover.plus.lib.region.IRegion
IRegion.DefaultVectorStrategy, IRegion.IVectorStrategy -
Constructor Summary
ConstructorsConstructorDescriptionDetectableArea(int x, int y) Creates a new detectable area with the given coordinates.DetectableArea(@NotNull org.bukkit.util.Vector min, @NotNull org.bukkit.util.Vector max) Creates a new detectable area with the given vectors. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.util.Vectormax()Gets the maximum vector.@NotNull org.bukkit.util.Vectormin()Gets the minimum vector.static @NotNull Button.DetectableAreaof(int x, int y) static @NotNull Button.DetectableAreaof(@NotNull org.bukkit.util.Vector min, @NotNull org.bukkit.util.Vector max) booleansingular()Check if the matrix is a single point.slots()Gets the slots of the button.booleanwithin(@NotNull org.bukkit.util.Vector vector, @NotNull IRegion.DefaultVectorStrategy strategy) Checks if the given vector is within the region.
-
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 vectormax- The maximum vector
-
DetectableArea
public DetectableArea(int x, int y) Creates a new detectable area with the given coordinates.- Parameters:
x- The x coordinatey- 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
-
min
@NotNull public @NotNull org.bukkit.util.Vector min()Gets the minimum vector. -
max
@NotNull public @NotNull org.bukkit.util.Vector max()Gets 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. -
singular
public boolean singular()Check if the matrix is a single point.- Returns:
- true if the matrix is a single point.
-
slots
Gets the slots of the button.- Returns:
- The slots
-