Fix player name casing in offline mode Bungee and Velocity proxies
Will attempt to correct while player is online
This commit is contained in:
1 parent
fd4c6a3954
commit
e5668c862a
2 files changed
+12
No files matched your search
+5
@@ -473,6 +473,11 @@ public class VotingPluginBungee extends Plugin implements Listener {
|
||||
public String getUUID(String playerName) {
|
||||
|
||||
if (!config.getOnlineMode()) {
|
||||
// correct casing
|
||||
ProxiedPlayer p = getProxy().getPlayer(playerName);
|
||||
if (p != null && p.isConnected()) {
|
||||
playerName = p.getName();
|
||||
}
|
||||
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(StandardCharsets.UTF_8))
|
||||
.toString();
|
||||
}
|
||||
|
||||
+7
@@ -561,6 +561,13 @@ public class VotingPluginVelocity {
|
||||
public String getUUID(String playerName) {
|
||||
|
||||
if (!config.getOnlineMode()) {
|
||||
// correct case
|
||||
if (server.getPlayer(playerName).isPresent()) {
|
||||
Player p = server.getPlayer(playerName).get();
|
||||
if (p != null && p.isActive()) {
|
||||
playerName = p.getUsername();
|
||||
}
|
||||
}
|
||||
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + playerName).getBytes(StandardCharsets.UTF_8))
|
||||
.toString();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user