Package com.marcusslover.plus.lib.region
Interface IRegion
- All Known Implementing Classes:
Button.DetectableArea,Region
public interface IRegion
Represents a 2d region with two points.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAll default strategies for the vector check.static interfaceRepresents a vector strategy. -
Method Summary
Modifier and TypeMethodDescriptiondefault doublegetMaxX()Gets the maximum x value of the region.default doublegetMaxY()Gets the maximum y value of the region.default doublegetMaxZ()Gets the maximum z value of the region.default doublegetMinX()Gets the minimum x value of the region.default doublegetMinY()Gets the minimum y value of the region.default doublegetMinZ()Gets the minimum z value of the region.@NotNull org.bukkit.util.Vectormax()Gets the maximum point of the region.@NotNull org.bukkit.util.Vectormin()Gets the minimum point of the region.default booleanwithin(@NotNull org.bukkit.Location location) Check if the given location is within the region.default booleanwithin(@NotNull org.bukkit.Location location, boolean excludeY) Check if the given location is within the region.default booleanwithin(@NotNull org.bukkit.entity.Entity entity) Check if the given entity is within the region.default booleanwithin(@NotNull org.bukkit.entity.Entity entity, boolean excludeY) Check if the given entity is within the region.default booleanwithin(@NotNull org.bukkit.util.Vector vector) Check if the given vector is within the region.default booleanwithin(@NotNull org.bukkit.util.Vector vector, boolean excludeY) Check if the given vector is within the region.default booleanwithin(@NotNull org.bukkit.util.Vector vector, @NotNull IRegion.DefaultVectorStrategy strategy) Check if the given vector is within the region.default booleanwithin(@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.
-