<commit_before>package mcjty.lostcities.dimensions.world;

import mcjty.lib.tools.EntityTools;
import mcjty.lostcities.config.LostCityConfiguration;
import mcjty.lostcities.dimensions.world.terrain.lost.BuildingInfo;
import mcjty.lostcities.dimensions.world.terrain.lost.GenInfo;
import mcjty.lostcities.dimensions.world.terrain.lost.LostCitiesTerrainGenerator;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockVine;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.IWorldGenerator;
import org.apache.commons.lang3.tuple.Pair;

import java.util.Map;
import java.util.Random;

public class LostCityWorldGenerator implements IWorldGenerator {

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
//        if (information.getTerrainType() == TerrainType.TERRAIN_LOSTCITIES) {
            generateLootSpawners(random, chunkX, chunkZ, world);
            generateVines(random, chunkX, chunkZ, world);
//        }
    }

    private void generateVines(Random random, int chunkX, int chunkZ, World world) {
        int cx = chunkX * 16;
        int cz = chunkZ * 16;
        BuildingInfo info = new BuildingInfo(chunkX, chunkZ, world.getSeed());

        int bottom = Math.max(LostCityConfiguration.GROUNDLEVEL + 3, info.hasBuilding ? (LostCityConfiguration.GROUNDLEVEL + 6 + info.floors * 6) : (LostCityConfiguration.GROUNDLEVEL + 3));

        if (info.getXmin().hasBuilding) {
            if (info.getXmin().getDamageArea().getDamageFactor() < .4f) {
                for (int z = 0; z < 15; z++) {
                    for (int y = bottom; y < (LostCityConfiguration.GROUNDLEVEL + info.getXmin().floors * 6); y++) {
                        if (random.nextFloat() < LostCityConfiguration.VINE_CHANCE) {
                            createVineStrip(random, world, bottom, y, BlockVine.WEST, cx + 0, cz + z);<commit_msg>Fixed non-Lost City generation types so the vines and other things are not used there<commit_after>package mcjty.lostcities.dimensions.world;

import mcjty.lib.tools.EntityTools;
import mcjty.lostcities.config.LostCityConfiguration;
import mcjty.lostcities.dimensions.world.terrain.lost.BuildingInfo;
import mcjty.lostcities.dimensions.world.terrain.lost.GenInfo;
import mcjty.lostcities.dimensions.world.terrain.lost.LostCitiesTerrainGenerator;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockVine;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.tileentity.TileEntityMobSpawner;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.common.IWorldGenerator;
import org.apache.commons.lang3.tuple.Pair;

import java.util.Map;
import java.util.Random;

public class LostCityWorldGenerator implements IWorldGenerator {

    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
        if (chunkGenerator instanceof LostCityChunkGenerator) {
            generateLootSpawners(random, chunkX, chunkZ, world);
            generateVines(random, chunkX, chunkZ, world);
        }
    }

    private void generateVines(Random random, int chunkX, int chunkZ, World world) {
        int cx = chunkX * 16;
        int cz = chunkZ * 16;
        BuildingInfo info = new BuildingInfo(chunkX, chunkZ, world.getSeed());

        int bottom = Math.max(LostCityConfiguration.GROUNDLEVEL + 3, info.hasBuilding ? (LostCityConfiguration.GROUNDLEVEL + 6 + info.floors * 6) : (LostCityConfiguration.GROUNDLEVEL + 3));

        if (info.getXmin().hasBuilding) {
            if (info.getXmin().getDamageArea().getDamageFactor() < .4f) {
                for (int z = 0; z < 15; z++) {
                    for (int y = bottom; y < (LostCityConfiguration.GROUNDLEVEL + info.getXmin().floors * 6); y++) {
                        if (random.nextFloat() < LostCityConfiguration.VINE_CHANCE) {
                            createVineStrip(random, world, bottom, y, BlockVine.WEST, cx + 0, cz + z);
{'fraction_non_alphanumeric': 0.10356570512820513, 'fraction_numerical': 0.006009615384615385, 'mean_word_length': 3.9731075697211153, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2372920', 'n_tokens_mistral': 1576, 'n_tokens_neox': 1500, 'n_words': 308}