Package tk.airshipcraft.commonlib.world
Class GlobalYLimitedArea
java.lang.Object
tk.airshipcraft.commonlib.world.AbstractYLimitedArea
tk.airshipcraft.commonlib.world.GlobalYLimitedArea
- All Implemented Interfaces:
IArea
Represents a world-limited area with vertical bounds that extend infinitely along the X and Z axes. This class provides functionality to work with and determine locations within these vertical boundaries within a specific world context.
This class is particularly useful for operations that are concerned with vertical sections of the world, such as checking if entities are within a certain Y-level range or applying effects to those regions.
- Since:
- 2023-04-01
- Version:
- 1.0.0
- Author:
- notzune
-
Constructor Summary
ConstructorsConstructorDescriptionGlobalYLimitedArea
(double lowerYBound, double upperYBound, org.bukkit.World world) Constructs a newGlobalYLimitedArea
with specified Y boundaries in a given world. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.Location
Gets the center of the global Y-limited area.Collection<org.bukkit.Chunk>
This method returns null because the area is not confined to specific chunks, thus spanning an infinite amount of chunks in the X and Z dimensions.This method returns null because the area spans an infinite number of pseudo chunks.org.bukkit.World
getWorld()
Retrieves the world where this Y-limited area exists.boolean
isInArea
(org.bukkit.Location loc) Checks if a location is within the vertical (Y) boundaries of this global area.Methods inherited from class tk.airshipcraft.commonlib.world.AbstractYLimitedArea
getLowerYBound, getUpperYBound
-
Constructor Details
-
GlobalYLimitedArea
public GlobalYLimitedArea(double lowerYBound, double upperYBound, org.bukkit.World world) Constructs a newGlobalYLimitedArea
with specified Y boundaries in a given world.- Parameters:
lowerYBound
- The lower Y boundary of the area.upperYBound
- The upper Y boundary of the area.world
- The world in which this area is defined.
-
-
Method Details
-
getChunks
This method returns null because the area is not confined to specific chunks, thus spanning an infinite amount of chunks in the X and Z dimensions.- Returns:
- Null, indicating an infinite number of chunks in the area.
-
getCenter
public org.bukkit.Location getCenter()Gets the center of the global Y-limited area. Since this area spans the entire world, the center is conceptually at the origin of the world coordinates.- Returns:
- The center
Location
at the origin of the world coordinates.
-
getWorld
public org.bukkit.World getWorld()Retrieves the world where this Y-limited area exists.- Returns:
- The
World
instance associated with this area.
-
isInArea
public boolean isInArea(org.bukkit.Location loc) Checks if a location is within the vertical (Y) boundaries of this global area.- Specified by:
isInArea
in interfaceIArea
- Overrides:
isInArea
in classAbstractYLimitedArea
- Parameters:
loc
- The location to check.- Returns:
- True if the location's Y-level falls within the boundaries, false otherwise.
-
getPseudoChunks
This method returns null because the area spans an infinite number of pseudo chunks. Pseudo chunks are a representation of chunk locations without loading the actual chunks.- Returns:
- Null, indicating an infinite number of pseudo chunks in the area.
-