Class SafeLocationManager

java.lang.Object
dev.cwhead.GravesX.manager.SafeLocationManager

public final class SafeLocationManager extends Object
Resolves safe teleport and grave placement locations. Prefers fluid surface placement when configured.
  • Constructor Details

    • SafeLocationManager

      public SafeLocationManager(Graves plugin)
  • Method Details

    • getNetherRoofLimit

      public int getNetherRoofLimit(org.bukkit.World world, Grave grave)
      Returns the configured Nether roof Y limit for the given world.
    • isAboveNetherRoof

      public boolean isAboveNetherRoof(org.bukkit.Location location, Grave grave)
      Returns whether the location is above the configured Nether roof limit.
    • setLastSolidLocation

      public void setLastSolidLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location)
      Stores the last solid location for an entity.
      Parameters:
      entity - The entity.
      location - The location.
    • getLastSolidLocation

      public org.bukkit.Location getLastSolidLocation(org.bukkit.entity.Entity entity)
      Gets the last solid location for an entity.
      Parameters:
      entity - The entity.
      Returns:
      The location, or null if not available.
    • removeLastSolidLocation

      public void removeLastSolidLocation(org.bukkit.entity.Entity entity)
      Removes the last solid location for an entity.
      Parameters:
      entity - The entity.
    • getSafeTeleportLocation

      public org.bukkit.Location getSafeTeleportLocation(org.bukkit.entity.Entity entity, org.bukkit.Location location, Grave grave, Graves plugin)
      Gets a safe teleport location.
      Parameters:
      entity - The entity.
      location - The location.
      grave - The grave.
      plugin - The plugin.
      Returns:
      The safe location, or null if not found.
    • getSafeGraveLocation

      public org.bukkit.Location getSafeGraveLocation(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave)
      Gets a safe grave location.
      Parameters:
      livingEntity - The entity.
      location - The location.
      grave - The grave.
      Returns:
      The safe location, or null if not found.
    • resolveSafeGravePlacement

      public SafeLocationManager.GravePlacementResult resolveSafeGravePlacement(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, Grave grave)
      Resolves a safe grave placement result.
      Parameters:
      livingEntity - The entity.
      location - The location.
      grave - The grave.
      Returns:
      The placement result, or null if the input location is null.
    • canBuild

      public boolean canBuild(org.bukkit.entity.LivingEntity livingEntity, org.bukkit.Location location, List<String> permissionList)
      Checks if an entity can build at a location.
      Parameters:
      livingEntity - The entity.
      location - The location.
      permissionList - The permission list.
      Returns:
      True if building is allowed, otherwise false.
    • isLocationSafePlayer

      public boolean isLocationSafePlayer(org.bukkit.Location location)
      Checks if a player location is safe.
      Parameters:
      location - The location.
      Returns:
      True if safe, otherwise false.
    • isLocationSafeGrave

      public boolean isLocationSafeGrave(org.bukkit.Location location)
      Checks if a grave location is safe.
      Parameters:
      location - The location.
      Returns:
      True if safe, otherwise false.
    • hasGrave

      public boolean hasGrave(org.bukkit.Location location)
      Checks if a grave exists at a location.
      Parameters:
      location - The location.
      Returns:
      True if a grave exists, otherwise false.
    • isInsideBorder

      public boolean isInsideBorder(org.bukkit.Location location)
      Checks if a location is inside the world border.
      Parameters:
      location - The location.
      Returns:
      True if inside the border, otherwise false.
    • isVoid

      public boolean isVoid(org.bukkit.Location location)
      Checks if a location is in the void.
      Parameters:
      location - The location.
      Returns:
      True if in the void, otherwise false.
    • getMinHeight

      public int getMinHeight(org.bukkit.Location location)
      Gets the minimum height for a location.
      Parameters:
      location - The location.
      Returns:
      The minimum height.