Package com.khorn.terraincontrol.configuration.io

Examples of com.khorn.terraincontrol.configuration.io.MemorySettingsReader


     * Creates a simple biome config.
     * @return The config.
     */
    private BiomeConfig createBiomeConfig()
    {
        SettingsReader settingsReader = new MemorySettingsReader("Test");
        StandardBiomeTemplate biomeTemplate = new StandardBiomeTemplate(TerrainControl.WORLD_HEIGHT);
        BiomeLoadInstruction loadInstruction = new BiomeLoadInstruction("Test", 0, biomeTemplate);

        // We can't create a WorldConfig object, so just pass a null parameter
        return new BiomeConfig(settingsReader, loadInstruction, null);
View Full Code Here


        // An empty CustomObjects instance with the global objects as fallback
        // would work just as well
        this.customObjects = TerrainControl.getCustomObjectManager().getGlobalObjects();

        // Create WorldConfig
        SettingsReader worldSettingsReader = new MemorySettingsReader(world.getName());
        worldSettingsReader.putSetting(WorldStandardValues.WORLD_FOG, stream.readInt());
        worldSettingsReader.putSetting(WorldStandardValues.WORLD_NIGHT_FOG, stream.readInt());
        worldConfig = new WorldConfig(worldSettingsReader, world, customObjects);

        // Custom biomes + ids
        int count = stream.readInt();
        while (count-- > 0)
        {
            String biomeName = ConfigFile.readStringFromStream(stream);
            int id = stream.readInt();
            worldConfig.customBiomeGenerationIds.put(biomeName, id);
        }

        // BiomeConfigs
        StandardBiomeTemplate defaultSettings = new StandardBiomeTemplate(worldConfig.worldHeightCap);
        biomes = new LocalBiome[world.getMaxBiomesCount()];

        count = stream.readInt();
        while (count-- > 0)
        {
            int id = stream.readInt();
            String biomeName = ConfigFile.readStringFromStream(stream);
            SettingsReader biomeReader = new MemorySettingsReader(biomeName);
            biomeReader.putSetting(BiomeStandardValues.BIOME_TEMPERATURE, stream.readFloat());
            biomeReader.putSetting(BiomeStandardValues.BIOME_WETNESS, stream.readFloat());
            biomeReader.putSetting(BiomeStandardValues.SKY_COLOR, stream.readInt());
            biomeReader.putSetting(BiomeStandardValues.WATER_COLOR, stream.readInt());
            biomeReader.putSetting(BiomeStandardValues.GRASS_COLOR, stream.readInt());
            biomeReader.putSetting(BiomeStandardValues.GRASS_COLOR_IS_MULTIPLIER, stream.readBoolean());
            biomeReader.putSetting(BiomeStandardValues.FOLIAGE_COLOR, stream.readInt());
            biomeReader.putSetting(BiomeStandardValues.FOLIAGE_COLOR_IS_MULTIPLIER, stream.readBoolean());

            BiomeLoadInstruction instruction = new BiomeLoadInstruction(biomeName, id, defaultSettings);
            BiomeConfig config = new BiomeConfig(biomeReader, instruction, worldConfig);
            config.process();
            LocalBiome biome = world.createBiomeFor(config, new BiomeIds(id));
View Full Code Here

TOP

Related Classes of com.khorn.terraincontrol.configuration.io.MemorySettingsReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.