mirror of
https://github.com/kaboomserver/extras.git
synced 2025-07-24 14:33:47 +00:00
Preserve pitch and yaw when teleporting
This commit is contained in:
parent
cf138a561b
commit
3b29ee5dc0
7 changed files with 77 additions and 40 deletions
|
@ -32,11 +32,10 @@ public final class CommandUsername implements CommandExecutor {
|
|||
} else if (millisDifference <= 2000) {
|
||||
player.sendMessage("Please wait a few seconds before changing your username");
|
||||
} else {
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
if (name.equals(onlinePlayer.getName())) {
|
||||
player.sendMessage("A player with that username is already logged in");
|
||||
return true;
|
||||
}
|
||||
if (Bukkit.getPlayer(name) != null
|
||||
&& Bukkit.getPlayer(name).isOnline()) {
|
||||
player.sendMessage("A player with that username is already logged in");
|
||||
return true;
|
||||
}
|
||||
|
||||
final PlayerProfile profile = player.getPlayerProfile();
|
||||
|
@ -44,7 +43,6 @@ public final class CommandUsername implements CommandExecutor {
|
|||
profile.setName(name);
|
||||
|
||||
player.setPlayerProfile(profile);
|
||||
player.setOp(true);
|
||||
|
||||
millis = System.currentTimeMillis();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue