Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,25 @@ protected CommandResultType perform(EssentialsPlugin plugin) {
User user = this.plugin.getUser(player.getUniqueId());
if (user == null) return CommandResultType.SYNTAX_ERROR; // Only if its console

if (ConfigStorage.spawnLocation == null || !ConfigStorage.spawnLocation.isValid()) {
message(sender, Message.COMMAND_SPAWN_NOT_DEFINE);
return CommandResultType.DEFAULT;
}

Location location = ConfigStorage.spawnLocation.getLocation();
if (location == null) {
message(sender, Message.COMMAND_SPAWN_NOT_DEFINE);
return CommandResultType.DEFAULT;
}

user.teleport(location, Message.TELEPORT_MESSAGE_SPAWN, Message.TELEPORT_SUCCESS_SPAWN);
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);
}
Comment on lines +48 to +55

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

if (this.user == null || user != this.user) {
message(sender, Message.TELEPORT_MESSAGE_SPAWN_CONSOLE, player);
}
Expand Down