<commit_before>package com.khorn.terraincontrol.forge;

import java.io.File;

import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import net.minecraft.src.WorldChunkManager;
import net.minecraft.src.WorldClient;
import net.minecraft.src.WorldType;

import com.khorn.terraincontrol.configuration.WorldConfig;

public class TCWorldType extends WorldType
{
    public SingleWorld worldTC;
    private TCPlugin plugin;

    public TCWorldType(TCPlugin plugin, int paramInt, String paramString)
    {
        super(paramInt, paramString);
        this.plugin = plugin;
    }

    @Override
    public WorldChunkManager getChunkManager(World world)
    {
        if (world instanceof WorldClient)
            return super.getChunkManager(world);
        
        // Restore old biomes
        SingleWorld.restoreBiomes();

        // Load everything
        File worldDirectory = new File(plugin.terrainControlDirectory, "worlds" + File.separator + world.getSaveHandler().getSaveDirectoryName());

        if (!worldDirectory.exists())
        {
            System.out.println("TerrainControl: settings does not exist, creating defaults");

            if (!worldDirectory.mkdirs())
                System.out.println("TerrainControl: cant create folder " + worldDirectory.getAbsolutePath());
        }

        this.worldTC = new SingleWorld(world.getSaveHandler().getSaveDirectoryName());
        WorldConfig config = new WorldConfig(worldDirectory, worldTC, false);
        this.worldTC.Init(world, config);

        WorldChunkManager ChunkManager = null;

        switch (this.worldTC.getSettings().ModeBiome)
        {
        case FromImage:
        case Normal:
            ChunkManager = new BiomeManager(this.worldTC);
            this.worldTC.setBiomeManager((BiomeManager) ChunkManager);
            break;
        case OldGenerator:
            ChunkManager = new BiomeManagerOld(this.worldTC);
            this.worldTC.setOldBiomeManager((BiomeManagerOld) ChunkManager);
            break;
        case Default:
            ChunkManager = super.getChunkManager(world);
            break;
        }

        return ChunkManager;
    }

    @Override
    public IChunkProvider getChunkGenerator(World world, String generatorOptions)
    {
        if (this.worldTC.getSettings().ModeTerrain != WorldConfig.TerrainMode.Default)
        {
            return this.worldTC.getChunkGenerator();
        } else
            return super.getChunkGenerator(world, generatorOptions);
    }

}
<commit_msg>Fix another dependency on the client<commit_after>package com.khorn.terraincontrol.forge;

import java.io.File;

import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import net.minecraft.src.WorldChunkManager;
import net.minecraft.src.WorldClient;
import net.minecraft.src.WorldType;

import com.khorn.terraincontrol.configuration.WorldConfig;

public class TCWorldType extends WorldType
{
    public SingleWorld worldTC;
    private TCPlugin plugin;

    public TCWorldType(TCPlugin plugin, int paramInt, String paramString)
    {
        super(paramInt, paramString);
        this.plugin = plugin;
    }

    @Override
    public WorldChunkManager getChunkManager(World world)
    {
        try
        {
            if (world instanceof WorldClient)
            {
                return super.getChunkManager(world);
            }
        } catch (NoClassDefFoundError e)
        {
            // There isn't a WorldClient class, so we are on a stand-alone
            // server. Continue normally.
        }

        // Restore old biomes
        SingleWorld.restoreBiomes();

        // Load everything
        File worldDirectory = new File(plugin.terrainControlDirectory, "worlds" + File.separator + world.getSaveHandler().getSaveDirectoryName());

        if (!worldDirectory.exists())
        {
            System.out.println("TerrainControl: settings does not exist, creating defaults");

            if (!worldDirectory.mkdirs())
                System.out.println("TerrainControl: cant create folder " + worldDirectory.getAbsolutePath());
        }

        this.worldTC = new SingleWorld(world.getSaveHandler().getSaveDirectoryName());
        WorldConfig config = new WorldConfig(worldDirectory, worldTC, false);
        this.worldTC.Init(world, config);

        WorldChunkManager ChunkManager = null;

        switch (this.worldTC.getSettings().ModeBiome)
        {
        case FromImage:
        case Normal:
            ChunkManager = new BiomeManager(this.worldTC);
            this.worldTC.setBiomeManager((BiomeManager) ChunkManager);
            break;
        case OldGenerator:
            ChunkManager = new BiomeManagerOld(this.worldTC);
            this.worldTC.setOldBiomeManager((BiomeManagerOld) ChunkManager);
            break;
        case Default:
            ChunkManager = super.getChunkManager(world);
            break;
        }

        return ChunkManager;
    }

    @Override
    public IChunkProvider getChunkGenerator(World world, String generatorOptions)
    {
        if (this.worldTC.getSettings().ModeTerrain != WorldConfig.TerrainMode.Default)
        {
            return this.worldTC.getChunkGenerator();
        } else
            return super.getChunkGenerator(world, generatorOptions);
    }

}

{'fraction_non_alphanumeric': 0.08482960791498717, 'fraction_numerical': 0.0, 'mean_word_length': 2.3125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4438480', 'n_tokens_mistral': 1465, 'n_tokens_neox': 1375, 'n_words': 293}