Skip to content

feat: add per-warp distance overrides#146

Open
mmenanno wants to merge 2 commits intoNiestrat99:v6from
mmenanno:feature/per-warp-distance-overrides
Open

feat: add per-warp distance overrides#146
mmenanno wants to merge 2 commits intoNiestrat99:v6from
mmenanno:feature/per-warp-distance-overrides

Conversation

@mmenanno
Copy link

@mmenanno mmenanno commented Feb 7, 2026

Information

Adds a warp-distance-overrides config section that allows admins to set a custom distance limit for individual warps when enable-distance-limitations is enabled. Closes #145.

Problem: The distance limiter applies uniformly to all warps. Admins who want to restrict casual /warp usage to nearby areas have no way to exempt specific warps (server landmarks, community builds, dungeons) without granting at.admin.bypass.distance-limit, which bypasses ALL distance checks.

Solution: New config section where admins can specify per-warp overrides:

warp-distance-overrides:
  caverns: -1      # No distance limit
  temple: -1       # No distance limit
  market: 5000     # Custom 5000 block limit
  • -1 removes the distance limit entirely for that warp
  • Positive values override the default maximum-teleport-distance for that warp
  • Warps not listed continue to use the normal distance limit
  • Only affects the warp command; other teleport commands (tpa, home, spawn, back) are unaffected
  • The at.admin.bypass.distance-limit permission still works as before
  • Cross-world warps still bypass distance checks (existing behavior)

Files changed:

  • config/config.yml — Added commented-out example section
  • MainConfig.java — Registered WARP_DISTANCE_OVERRIDES config option
  • DistanceLimiter.java — Added overload that checks warp overrides before falling through to normal behavior
  • ConditionChecker.java — Added overload to pass location name through to DistanceLimiter
  • TeleportTrackingManager.java — Passes locName from ATTeleportEvent to ConditionChecker

Prior to Merging

  • Does the PR need documenting on the wiki? If not, remove this, otherwise, leave this unchecked until a respective PR has been made for the wiki.
  • Has the PR been tested?
  • Do you consent to GitHub Copilot also reviewing your changes? An actual developer will review your changes first.

Allow admins to set a custom distance limit for individual warps via
the new `warp-distance-overrides` config section. Setting a value of
-1 removes the distance limit entirely for that warp, while positive
values override the default maximum-teleport-distance for that warp.

Closes Niestrat99#145
Copy link
Collaborator

@Thatsmusic99 Thatsmusic99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, small config nit - sorry for taking a while on this, I've had a busy week and weekend

@mmenanno
Copy link
Author

Fixed it! And thanks for having a look, no rush!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Per-warp distance limitation exemptions

2 participants