aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/net/elytrium/limboauth/LimboAuth.java14
-rw-r--r--src/main/java/net/elytrium/limboauth/listener/AuthListener.java10
2 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/net/elytrium/limboauth/LimboAuth.java b/src/main/java/net/elytrium/limboauth/LimboAuth.java
index b2d2e43..f8e3755 100644
--- a/src/main/java/net/elytrium/limboauth/LimboAuth.java
+++ b/src/main/java/net/elytrium/limboauth/LimboAuth.java
@@ -494,8 +494,20 @@ public class LimboAuth {
if (onlineMode || isFloodgate) {
if (registeredPlayer == null || registeredPlayer.getHash().isEmpty()) {
+ RegisteredPlayer nicknameRegisteredPlayer = registeredPlayer;
registeredPlayer = AuthSessionHandler.fetchInfo(this.playerDao, player.getUniqueId());
- if (registeredPlayer == null && Settings.IMP.MAIN.SAVE_PREMIUM_ACCOUNTS) {
+
+ if (nicknameRegisteredPlayer != null && registeredPlayer == null && nicknameRegisteredPlayer.getHash().isEmpty()) {
+ registeredPlayer = nicknameRegisteredPlayer;
+ registeredPlayer.setPremiumUuid(player.getUniqueId().toString());
+ try {
+ this.playerDao.update(registeredPlayer);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ if (nicknameRegisteredPlayer == null && registeredPlayer == null && Settings.IMP.MAIN.SAVE_PREMIUM_ACCOUNTS) {
registeredPlayer = new RegisteredPlayer(
nickname,
nickname.toLowerCase(Locale.ROOT),
diff --git a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
index 2c4b668..2529e80 100644
--- a/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
+++ b/src/main/java/net/elytrium/limboauth/listener/AuthListener.java
@@ -94,16 +94,6 @@ public class AuthListener {
if (registeredPlayer != null) {
String currentUuid = registeredPlayer.getUuid();
- if (event.isOnlineMode() && registeredPlayer.getHash().isEmpty() && registeredPlayer.getPremiumUuid().isEmpty()) {
- try {
- registeredPlayer.setPremiumUuid(event.getOriginalProfile().getId().toString());
- this.playerDao.update(registeredPlayer);
- } catch (SQLException e) {
- e.printStackTrace();
- return;
- }
- }
-
if (currentUuid.isEmpty()) {
try {
registeredPlayer.setUuid(event.getGameProfile().getId().toString());