Package tk.airshipcraft.commonlib.world
Class AbstractYLimitedArea
java.lang.Object
tk.airshipcraft.commonlib.world.AbstractYLimitedArea
- All Implemented Interfaces:
IArea
- Direct Known Subclasses:
EllipseArea
,GlobalYLimitedArea
,RectangleArea
An abstract implementation of a Y-limited area. This class provides a basic structure
for areas that are bounded vertically between two Y levels. It can be extended to create
specific area types with additional constraints on the X and Z axes.
- Since:
- 2023-04-01
- Version:
- 1.0.0
- Author:
- notzune
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractYLimitedArea
(double lowerYBound, double upperYBound) Constructs anAbstractYLimitedArea
with specified lower and upper Y bounds. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Retrieves the lower Y boundary of the area.double
Retrieves the upper Y boundary of the area.boolean
isInArea
(org.bukkit.Location loc) Determines whether a given location falls within the vertical bounds of the area.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tk.airshipcraft.commonlib.world.IArea
getCenter, getChunks, getPseudoChunks, getWorld
-
Constructor Details
-
AbstractYLimitedArea
public AbstractYLimitedArea(double lowerYBound, double upperYBound) Constructs anAbstractYLimitedArea
with specified lower and upper Y bounds.- Parameters:
lowerYBound
- The minimum Y value that is considered part of the area.upperYBound
- The maximum Y value that is considered part of the area.- Throws:
IllegalArgumentException
- If the lowerYBound is greater than the upperYBound.
-
-
Method Details
-
isInArea
public boolean isInArea(org.bukkit.Location loc) Determines whether a given location falls within the vertical bounds of the area. -
getLowerYBound
public double getLowerYBound()Retrieves the lower Y boundary of the area.- Returns:
- The minimum Y value included in the area.
-
getUpperYBound
public double getUpperYBound()Retrieves the upper Y boundary of the area.- Returns:
- The maximum Y value included in the area.
-