mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge pull request #2888 from IntellectualSites/fix-conversion
Fix problem with config creation
This commit is contained in:
commit
300abd868a
@ -1736,10 +1736,11 @@ public class PlotSquared {
|
|||||||
|
|
||||||
if (this.worlds.contains("worlds")) {
|
if (this.worlds.contains("worlds")) {
|
||||||
if (!this.worlds.contains("configuration_version") || (
|
if (!this.worlds.contains("configuration_version") || (
|
||||||
!this.worlds.getString("configuration_version")
|
!this.worlds.getString("configuration_version").equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) &&
|
||||||
.equalsIgnoreCase(LegacyConverter.CONFIGURATION_VERSION) && !this.worlds
|
!this.worlds.getString("configuration_version").equalsIgnoreCase("v5"))) {
|
||||||
.getString("configuration_version").equalsIgnoreCase("v5"))) {
|
// This means that the server is updating from version 3 to version 5. For this to be possible,
|
||||||
// Conversion needed
|
// it must first go through v3->v4 (post_flattening), then on next restart
|
||||||
|
// it must do v4 (post_flattening) -> v5
|
||||||
log(Captions.LEGACY_CONFIG_FOUND.getTranslated());
|
log(Captions.LEGACY_CONFIG_FOUND.getTranslated());
|
||||||
try {
|
try {
|
||||||
com.google.common.io.Files
|
com.google.common.io.Files
|
||||||
@ -1761,7 +1762,9 @@ public class PlotSquared {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.worlds.set("configuration_version", LegacyConverter.CONFIGURATION_VERSION);
|
// If the server does not have a worlds section in their
|
||||||
|
// worlds.yml, we assume they generated their database using v5
|
||||||
|
this.setConfigurationVersion("v5");
|
||||||
}
|
}
|
||||||
} catch (IOException ignored) {
|
} catch (IOException ignored) {
|
||||||
PlotSquared.log("Failed to save settings.yml");
|
PlotSquared.log("Failed to save settings.yml");
|
||||||
|
Loading…
Reference in New Issue
Block a user