Skip to content

feat: add experimental teleport failsafe with configurable farming scope - #170

Open
mc3545dada wants to merge 1 commit into
mizly:mainfrom
mc3545dada:feat/experimental-teleport-failsafe
Open

mc3545dada wants to merge 1 commit into
mizly:mainfrom
mc3545dada:feat/experimental-teleport-failsafe

Conversation

@mc3545dada

Copy link
Copy Markdown

What this changes

Adds an experimental Teleport failsafe under Modules → Failsafes → Teleport, with the existing Stop / Ignore / Custom action system and a default-on Only During Farming toggle.

The check observes server player-position packets on the game thread, before vanilla applies the new position. It resolves absolute and relative coordinates using Minecraft's own PositionMoveRotation.calculateAbsolute, then compares the destination with the current client position. Ordinary client movement alone does not trigger it. Pure rotation-only packets with zero displacement are ignored; this does not replace the existing Rotation failsafe.

Detection scope and exclusions

  • Enabled by default, with Stop as the default action.
  • Only During Farming = ON (default): checks only active farming steps in the Garden. Pest cleaning, pest preparation/interruptions, rewarping, visiting, and other non-farming phases are excluded.
  • Only During Farming = OFF: also checks other running macro phases, including outside the Garden. Macro OFF / RECOVERING, restart sequences, and the existing manual-pest suspension remain excluded.
  • A vertical displacement whose absolute value is at least the vertical limit triggers independently of horizontal distance. Otherwise, horizontal distance is measured as hypot(dx, dz) and must be greater than the horizontal limit.
  • For horizontal-only detections, holding an item whose name matches Aspect of the…, Hyperion, Scylla, Valkyrie, or Astraea suppresses the detection. This exception does not suppress qualifying vertical displacement.
  • Recognized outgoing teleport commands are treated as requested teleports, whether typed manually or sent by automation. These include /warp garden, /plottp, /tptoplot, /hub, /lobby, and /visit. Therefore, manually executing /warp garden is not a positive test for this failsafe.
  • After a recognized request, the first position packet received within 10 seconds is treated as its response; the configurable settle period starts when that packet arrives. This is a heuristic, not an authoritative match between commands and server teleports.
  • Qualifying packets dispatch the selected action immediately, without an additional teleport-specific delay. Ignore still reports the detection. Custom uses the existing movement-replay system, which stops the running macro before playing the selected replay.

Settings and tuning

Setting Default Range / behavior How to adjust
Teleport toggle On Enables/disables this failsafe Turn off to disable the check entirely.
Only During Farming On Restricts detection to actual farming Leave on for the narrower, less noisy scope. Turning it off exposes flight, cleaning and other macro phases to position-correction false positives.
Teleport Action Stop Stop / Ignore / Custom Stop ends the macro; Ignore reports and continues; Custom runs the selected local movement replay.
Horizontal Ignore Limit 6.0 blocks 0–64 blocks, 0.5-block steps; triggers only above this distance Increase manually if routine horizontal corrections cause false positives. For example, try 6 → 8 → 10 while observing the actual corrections. Larger values also miss smaller unexpected horizontal teleports.
Vertical Ignore Limit 0.5 blocks 0–10 blocks, 0.5-block steps; triggers at or above this height change, upward or downward Increase manually if vertical corrections cause false positives. For example, try 0.5 → 1.0 → 1.5. Larger values also miss smaller vertical teleports. At zero, every nonzero displacement satisfies the vertical comparison.
Teleport Settle Time 1.5 seconds 0–30 seconds, 0.5-second steps Increase manually if correction packets arrive after your own requested warp, e.g. 1.5 → 2.5 → 3.0 seconds. This only extends the post-requested-teleport suppression window; it does not filter unrelated corrections during ordinary farming. Zero still permits the recognized requested response, but adds no follow-up suppression.

Experimental status and network limitations

This feature is experimental. Its accuracy depends strongly on network latency and server/client synchronization. High latency, jitter, or packet loss/stalls can lead to delayed updates and larger server corrections, which this threshold-based detector may mistake for an unexpected teleport. The same position-packet mechanism is used for legitimate corrections and teleports; the detector cannot reliably identify the server's intent.

If false positives occur under poor network conditions, manually increase the relevant horizontal/vertical limits, and increase Teleport Settle Time when the false positive follows a requested warp. Adjust the parameter that matches the observed problem rather than raising everything indiscriminately. These changes reduce sensitivity and create a tradeoff: smaller unexpected movements may be missed, and longer settle windows leave more time unmonitored. Stable high-latency / packet-loss behavior is not guaranteed.

Validation

  • Full local Gradle build passed on JDK 25 / Minecraft 26.1.2, using installed Gradle 9.5.1.
  • 414 tests discovered: 396 passed, 18 skipped, with no failures or errors; opt-in graphics tests were not run.
  • Includes 17 teleport-related tests covering absolute/mixed-relative coordinates, horizontal and vertical boundaries, held-item exclusions, rotation-only packets, command recognition, request/settle windows, both farming-scope modes, and the actual Minecraft packet-hook signatures.
  • Translation keys synchronized, including Simplified Chinese entries; git diff --check passed.
  • No controlled gameplay validation across latency/packet-loss conditions or gameplay demonstration video is included. Further in-game testing is needed.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 04:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

2 participants