}
logger.info("World seed: \"{}\"", worldInfo.getSeed());
// TODO: Separate WorldRenderer from world handling in general
WorldGeneratorManager worldGeneratorManager = CoreRegistry.get(WorldGeneratorManager.class);
WorldGenerator worldGenerator;
try {
worldGenerator = worldGeneratorManager.createGenerator(worldInfo.getWorldGenerator());
// setting the world seed will create the world builder
worldGenerator.setWorldSeed(worldInfo.getSeed());
CoreRegistry.put(WorldGenerator.class, worldGenerator);
} catch (UnresolvedWorldGeneratorException e) {
logger.error("Unable to load world generator {}. Available world generators: {}",
worldInfo.getWorldGenerator(), worldGeneratorManager.getWorldGenerators());
CoreRegistry.get(GameEngine.class).changeState(new StateMainMenu("Failed to resolve world generator."));
return true; // We need to return true, otherwise the loading state will just call us again immediately
}
// Init. a new world