Class PrepAreaService

java.lang.Object
dev.deepcore.challenge.session.PrepAreaService

public final class PrepAreaService extends Object
Manages prep-area border assignment and movement clamping.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PrepAreaService(int prepAreaDiameterBlocks)
    Creates a prep-area service for the configured border diameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyBorder(org.bukkit.entity.Player player, boolean runningPhase, Predicate<org.bukkit.World> isLobbyWorld)
    Applies or clears the prep border for a single player.
    void
    applyBordersToOnlinePlayers(boolean runningPhase, Predicate<org.bukkit.World> isLobbyWorld)
    Applies prep borders to all online players when the run is not active.
    org.bukkit.Location
    clampToPrepArea(org.bukkit.Location location)
    Clamps a location to remain within the configured prep area bounds.
    void
    Clears per-player world borders for all online players.
    boolean
    isWithinPrepArea(org.bukkit.Location location)
    Returns whether a location lies inside the configured prep area bounds.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PrepAreaService

      public PrepAreaService(int prepAreaDiameterBlocks)
      Creates a prep-area service for the configured border diameter.
      Parameters:
      prepAreaDiameterBlocks - prep border diameter in blocks
  • Method Details

    • applyBordersToOnlinePlayers

      public void applyBordersToOnlinePlayers(boolean runningPhase, Predicate<org.bukkit.World> isLobbyWorld)
      Applies prep borders to all online players when the run is not active.
      Parameters:
      runningPhase - whether the challenge is currently in running phase
      isLobbyWorld - predicate identifying lobby worlds where borders should be cleared
    • clearBorders

      public void clearBorders()
      Clears per-player world borders for all online players.
    • applyBorder

      public void applyBorder(org.bukkit.entity.Player player, boolean runningPhase, Predicate<org.bukkit.World> isLobbyWorld)
      Applies or clears the prep border for a single player.
      Parameters:
      player - player whose per-player border should be updated
      runningPhase - whether the challenge is currently in running phase
      isLobbyWorld - predicate identifying lobby worlds where borders should be cleared
    • isWithinPrepArea

      public boolean isWithinPrepArea(org.bukkit.Location location)
      Returns whether a location lies inside the configured prep area bounds.
      Parameters:
      location - location to test
      Returns:
      true when location is inside prep bounds
    • clampToPrepArea

      public org.bukkit.Location clampToPrepArea(org.bukkit.Location location)
      Clamps a location to remain within the configured prep area bounds.
      Parameters:
      location - location to clamp
      Returns:
      clamped location guaranteed to stay within prep bounds