Restore /spawn cooldown for player self teleports - #203
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| boolean teleportingSelf = this.user != null && user == this.user; | ||
|
|
||
| if (teleportingSelf) { | ||
| user.teleport(location, Message.TELEPORT_MESSAGE_SPAWN, Message.TELEPORT_SUCCESS_SPAWN); | ||
| } else { | ||
| user.teleportNow(location); | ||
| message(user, Message.TELEPORT_SUCCESS_SPAWN); | ||
| } |
There was a problem hiding this comment.
Instant teleports skip safety adjustments
Switching non‑self /spawn teleports to user.teleportNow(location) bypasses the safety logic in User.teleport(...) that moves players to a safe block and centers them when teleportSafety or teleportToCenter are enabled. As a result, staff or console teleporting someone else can now place the target inside solid blocks or off‑center, which was previously prevented. This regression affects anyone using safety settings and should be reverted to the safe path or replicated before calling teleportNow.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f223210238832198dc632ffc00e080