浏览代码

Properly convert SQL to Flatfile when UUIDs are null

t00thpick1 10 年之前
父节点
当前提交
ca6dc5195d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java

+ 2 - 2
src/main/java/com/gmail/nossr50/database/FlatfileDatabaseManager.java

@@ -272,7 +272,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
                 while ((line = in.readLine()) != null) {
                     // Read the line in and copy it to the output if it's not the player we want to edit
                     String[] character = line.split(":");
-                    if (!character[41].equalsIgnoreCase(uuid.toString()) && !character[0].equalsIgnoreCase(playerName)) {
+                    if (!(uuid != null && character[41].equalsIgnoreCase(uuid.toString())) && !character[0].equalsIgnoreCase(playerName)) {
                         writer.append(line).append("\r\n");
                     }
                     else {
@@ -319,7 +319,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
                         writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":");
                         writer.append(profile.getSkillLevel(SkillType.ALCHEMY)).append(":");
                         writer.append(profile.getSkillXpLevel(SkillType.ALCHEMY)).append(":");
-                        writer.append(uuid.toString()).append(":");
+                        writer.append(uuid != null ? uuid.toString() : "NULL").append(":");
                         writer.append(profile.getScoreboardTipsShown()).append(":");
                         writer.append("\r\n");
                     }