}
// Obtain the world configuration information in MV
MVWorldManager manager = core.getMVWorldManager();
Map<String, WorldProperties> propsMap = SafeField.get(manager, "worldsFromTheConfig");
WorldProperties world = propsMap.get(config.worldname);
// Newly created world: no configuration in MV is available
if (world == null) {
MyWorlds.plugin.log(Level.WARNING, "World Configuration for '" + config.worldname +
"' could not be imported from Multiverse: No configuration available");
return false;
}
// Serialization could be incomplete - this is a (hackish) check for that
try {
world.getDifficulty();
} catch (NullPointerException ex) {
return false;
}
// Apply general world settings
config.difficulty = world.getDifficulty();
config.allowHunger = world.getHunger();
config.forcedRespawn = !world.getBedRespawn();
config.holdWeather = !world.isWeatherEnabled();
config.pvp = world.isPVPEnabled();
config.gameMode = world.getGameMode();
config.keepSpawnInMemory = world.isKeepingSpawnInMemory();
config.worldmode = WorldMode.get(config.worldmode.getType(), world.getEnvironment());
config.setChunkGeneratorName(world.getGenerator());
// Apply the (re)spawn point
String respawnWorldName = world.getRespawnToWorld();
WorldProperties respawnWorld = propsMap.get(respawnWorldName);
if (respawnWorld == null) {
respawnWorld = world;
respawnWorldName = config.worldname;
}
Location respawnLoc = respawnWorld.getSpawnLocation();
if (respawnLoc != null) {
config.spawnPoint = new Position(respawnLoc);
if (respawnLoc.getWorld() == null) {
config.spawnPoint.setWorldName(respawnWorldName);
}