feat: add per-warp distance overrides#146
Open
mmenanno wants to merge 2 commits intoNiestrat99:v6from
Open
Conversation
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
Collaborator
Thatsmusic99
left a comment
There was a problem hiding this comment.
Overall LGTM, small config nit - sorry for taking a while on this, I've had a busy week and weekend
...edTeleport-Bukkit/src/main/java/io/github/niestrat99/advancedteleport/config/MainConfig.java
Outdated
Show resolved
Hide resolved
Author
|
Fixed it! And thanks for having a look, no rush! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Information
Adds a
warp-distance-overridesconfig section that allows admins to set a custom distance limit for individual warps whenenable-distance-limitationsis enabled. Closes #145.Problem: The distance limiter applies uniformly to all warps. Admins who want to restrict casual
/warpusage to nearby areas have no way to exempt specific warps (server landmarks, community builds, dungeons) without grantingat.admin.bypass.distance-limit, which bypasses ALL distance checks.Solution: New config section where admins can specify per-warp overrides:
-1removes the distance limit entirely for that warpmaximum-teleport-distancefor that warpwarpcommand; other teleport commands (tpa, home, spawn, back) are unaffectedat.admin.bypass.distance-limitpermission still works as beforeFiles changed:
config/config.yml— Added commented-out example sectionMainConfig.java— RegisteredWARP_DISTANCE_OVERRIDESconfig optionDistanceLimiter.java— Added overload that checks warp overrides before falling through to normal behaviorConditionChecker.java— Added overload to pass location name through toDistanceLimiterTeleportTrackingManager.java— PasseslocNamefromATTeleportEventtoConditionCheckerPrior to Merging