diff options
Diffstat (limited to 'src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java')
-rw-r--r-- | src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java index 2fea6f5..ebe9032 100644 --- a/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java +++ b/src/main/java/net/elytrium/limboauth/command/ChangePasswordCommand.java @@ -34,6 +34,7 @@ import net.kyori.adventure.text.Component; public class ChangePasswordCommand implements SimpleCommand { + private final LimboAuth plugin; private final Dao<RegisteredPlayer, String> playerDao; private final boolean needOldPass; @@ -44,7 +45,8 @@ public class ChangePasswordCommand implements SimpleCommand { private final Component usage; private final Component notPlayer; - public ChangePasswordCommand(Dao<RegisteredPlayer, String> playerDao) { + public ChangePasswordCommand(LimboAuth plugin, Dao<RegisteredPlayer, String> playerDao) { + this.plugin = plugin; this.playerDao = playerDao; Serializer serializer = LimboAuth.getSerializer(); @@ -94,6 +96,8 @@ public class ChangePasswordCommand implements SimpleCommand { updateBuilder.updateColumnValue(RegisteredPlayer.HASH_FIELD, RegisteredPlayer.genHash(needOldPass ? args[1] : args[0])); updateBuilder.update(); + this.plugin.removePlayerFromCache(username); + source.sendMessage(this.successful); } catch (SQLException e) { source.sendMessage(this.errorOccurred); |