Class AbstractYLimitedArea

java.lang.Object
tk.airshipcraft.commonlib.world.AbstractYLimitedArea
All Implemented Interfaces:
IArea
Direct Known Subclasses:
EllipseArea, GlobalYLimitedArea, RectangleArea

public abstract class AbstractYLimitedArea extends Object implements IArea
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 Details

    • AbstractYLimitedArea

      public AbstractYLimitedArea(double lowerYBound, double upperYBound)
      Constructs an AbstractYLimitedArea 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.
      Specified by:
      isInArea in interface IArea
      Parameters:
      loc - The location to check.
      Returns:
      True if the Y value of the location is within the area's bounds, false otherwise.
    • 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.