@Override public void set(String value) { selectedWorld = value; try { if (findWorldByName(selectedWorld).getWorldGenerator() == null) { worldGenerator = WorldGeneratorManager.createWorldGenerator(findWorldByName(selectedWorld).getWorldGeneratorInfo().getUri(), context, environment); findWorldByName(selectedWorld).setWorldGenerator(worldGenerator); } else { worldGenerator = findWorldByName(selectedWorld).getWorldGenerator(); } if (worldGenerator.getWorldSeed() == null) { worldGenerator.setWorldSeed(createSeed(selectedWorld)); } previewGen = new FacetLayerPreview(environment, worldGenerator); updatePreview(); } catch (UnresolvedWorldGeneratorException e) { e.printStackTrace(); } } });
@Override public void onOpened() { try { if (findWorldByName(selectedWorld).getWorldGenerator() == null) { worldGenerator = WorldGeneratorManager.createWorldGenerator(findWorldByName(selectedWorld).getWorldGeneratorInfo().getUri(), context, environment); findWorldByName(selectedWorld).setWorldGenerator(worldGenerator); } else { worldGenerator = findWorldByName(selectedWorld).getWorldGenerator(); } if (worldGenerator.getWorldSeed().isEmpty()) { worldGenerator.setWorldSeed(createSeed(selectedWorld)); } previewGen = new FacetLayerPreview(environment, worldGenerator); updatePreview(); } catch (UnresolvedWorldGeneratorException e) { e.printStackTrace(); } }
i++; uri = world.getWorldGeneratorInfo().getUri(); worldInfo = new WorldInfo(TerasologyConstants.MAIN_WORLD + i, world.getWorldName().toString(), world.getWorldGenerator().getWorldSeed(), (long) (WorldTime.DAY_LENGTH * WorldTime.NOON_OFFSET), uri); gameManifest.addWorld(worldInfo);