Package com.khorn.terraincontrol.bukkit.generator

Examples of com.khorn.terraincontrol.bukkit.generator.TCChunkGenerator


    public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
    {
        if (worldName.isEmpty())
        {
            TerrainControl.log(LogMarker.DEBUG, "Ignoring empty world name. Is some generator plugin checking if \"TerrainControl\" is a valid world name?");
            return new TCChunkGenerator(this);
        }
        if (worldName.equals("test"))
        {
            TerrainControl.log(LogMarker.DEBUG,
                               "Ignoring world with the name \"test\". This is not a valid world name, ",
                               "as it's used by Multiverse to check if \"TerrainControl\" a valid generator name. ",
                               "So if you were just using /mv create, don't worry about this message.");
            return new TCChunkGenerator(this);
        }

        // Check if not already enabled
        BukkitWorld world = worlds.get(worldName);
        if (world != null)
        {
            TerrainControl.log(LogMarker.DEBUG, "Already enabled for ''{}''", (Object) worldName);
            return world.getChunkGenerator();
        }

        TerrainControl.log(LogMarker.INFO, "Starting to enable world ''{}''...", (Object) worldName);

        // Create BukkitWorld instance
        BukkitWorld localWorld = new BukkitWorld(worldName);

        // Hack to initialize CraftBukkit's biome mappings
        // This is really needed. Try for yourself if you don't believe it,
        // you will get a java.lang.IllegalArgumentException when adding biomes
        CraftBlock.biomeBaseToBiome(BiomeBase.OCEAN);

        // Load settings
        File baseFolder = getWorldSettingsFolder(worldName);
        WorldSettings configs = new WorldSettings(baseFolder, localWorld, false);
        localWorld.setSettings(configs);

        // Add the world to the to-do list
        this.notInitedWorlds.put(worldName, localWorld);

        // Get the right chunk generator
        TCChunkGenerator generator = null;
        switch (configs.worldConfig.ModeTerrain)
        {
            case Normal:
            case TerrainTest:
            case OldGenerator:
            case NotGenerate:
                generator = new TCChunkGenerator(this);
                break;
            case Default:
                break;
        }
View Full Code Here

TOP

Related Classes of com.khorn.terraincontrol.bukkit.generator.TCChunkGenerator

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.