mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Remove HudType from Flatfile records.
This commit is contained in:
parent
15f5dcf860
commit
a8e23e08ee
@ -593,18 +593,30 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (character.length < 33) {
|
||||||
|
// Before Version 1.0 - Drop
|
||||||
|
mcMMO.p.getLogger().warning("Dropping malformed or before version 1.0 line from database - " + line);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String oldVersion = null;
|
||||||
|
|
||||||
|
if (!character[33].isEmpty()) {
|
||||||
|
// Removal of Spout Support
|
||||||
|
// Version 1.4.07-dev2
|
||||||
|
// commit 7bac0e2ca5143bce84dc160617fed97f0b1cb968
|
||||||
|
line = line.replace(character[33], "");
|
||||||
|
oldVersion = "1.4.07";
|
||||||
|
}
|
||||||
|
|
||||||
// If they're valid, rewrite them to the file.
|
// If they're valid, rewrite them to the file.
|
||||||
if (character.length > 38) {
|
if (character.length > 38) {
|
||||||
writer.append(line).append("\r\n");
|
writer.append(line).append("\r\n");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (character.length < 33) {
|
|
||||||
// Before Version 1.0 - Drop
|
|
||||||
mcMMO.p.getLogger().warning("Dropping malformed or before version 1.0 line from database - " + line);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
String oldVersion = null;
|
|
||||||
StringBuilder newLine = new StringBuilder(line);
|
StringBuilder newLine = new StringBuilder(line);
|
||||||
boolean announce = false;
|
|
||||||
if (character.length <= 33) {
|
if (character.length <= 33) {
|
||||||
// Introduction of HUDType
|
// Introduction of HUDType
|
||||||
// Version 1.1.06
|
// Version 1.1.06
|
||||||
@ -637,7 +649,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
// commmit 3f6c07ba6aaf44e388cc3b882cac3d8f51d0ac28
|
// commmit 3f6c07ba6aaf44e388cc3b882cac3d8f51d0ac28
|
||||||
// XXX Cannot create an OfflinePlayer at startup, use 0 and fix in purge
|
// XXX Cannot create an OfflinePlayer at startup, use 0 and fix in purge
|
||||||
newLine.append("0").append(":");
|
newLine.append("0").append(":");
|
||||||
announce = true; // TODO move this down
|
|
||||||
if (oldVersion == null) {
|
if (oldVersion == null) {
|
||||||
oldVersion = "1.4.00";
|
oldVersion = "1.4.00";
|
||||||
}
|
}
|
||||||
@ -652,12 +663,12 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (announce) {
|
if (oldVersion != null) {
|
||||||
mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion);
|
mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.append(newLine).append("\r\n");
|
writer.append(newLine).append("\r\n");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Write the new file
|
// Write the new file
|
||||||
out = new FileWriter(usersFilePath);
|
out = new FileWriter(usersFilePath);
|
||||||
|
Loading…
Reference in New Issue
Block a user