mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-01-07 16:57:50 +01:00
Now actually allows world names with periods.
This commit is contained in:
parent
e69b5a6b17
commit
9f927605da
@ -96,6 +96,7 @@ import org.bukkit.command.Command;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.configuration.Configuration;
|
import org.bukkit.configuration.Configuration;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -550,12 +551,22 @@ public class MultiverseCore extends JavaPlugin implements MVPlugin, Core {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final char PATH_SEPARATOR = '\uF8FF';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate the worlds.yml to SerializationConfig.
|
* Migrate the worlds.yml to SerializationConfig.
|
||||||
*/
|
*/
|
||||||
private void migrateWorldConfig() { // SUPPRESS CHECKSTYLE: MethodLength
|
private void migrateWorldConfig() { // SUPPRESS CHECKSTYLE: MethodLength
|
||||||
FileConfiguration wconf = YamlConfiguration
|
FileConfiguration wconf = new YamlConfiguration();
|
||||||
.loadConfiguration(new File(getDataFolder(), "worlds.yml"));
|
wconf.options().pathSeparator(PATH_SEPARATOR);
|
||||||
|
File worldsFile = new File(getDataFolder(), "worlds.yml");
|
||||||
|
try {
|
||||||
|
wconf.load(worldsFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
log(Level.WARNING, "Cannot load worlds.yml");
|
||||||
|
} catch (InvalidConfigurationException e) {
|
||||||
|
log(Level.WARNING, "Your worlds.yml is invalid!");
|
||||||
|
}
|
||||||
|
|
||||||
if (!wconf.isConfigurationSection("worlds")) { // empty config
|
if (!wconf.isConfigurationSection("worlds")) { // empty config
|
||||||
this.log(Level.FINE, "No worlds to migrate!");
|
this.log(Level.FINE, "No worlds to migrate!");
|
||||||
|
Loading…
Reference in New Issue
Block a user