From 072e7c8b193b3c77ba03a889efd1eab266f0a84a Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Sat, 12 Jul 2014 15:59:56 +0200 Subject: [PATCH] Update playername in database when a name changes --- .../com/gmail/nossr50/database/FlatfileDatabaseManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java index 95819f9d8..daa14b962 100644 --- a/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java +++ b/src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java @@ -412,6 +412,12 @@ public final class FlatfileDatabaseManager implements DatabaseManager { continue; } + // Update playerName in database after name change + if (!character[0].equalsIgnoreCase(playerName)) { + mcMMO.p.debug("Name change detected: " + character[0] + " => " + playerName); + character[0] = playerName; + } + return loadFromLine(character); }