package net.minecraft.world.level.levelgen.feature;

import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import java.util.Random;
import net.minecraft.world.level.levelgen.structure.SwamplandHutPiece;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.StructureStart;
import com.google.common.collect.Lists;
import net.minecraft.world.entity.EntityType;
import com.mojang.serialization.Codec;
import net.minecraft.world.level.biome.Biome;
import java.util.List;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;

public class SwamplandHutFeature extends StructureFeature<NoneFeatureConfiguration> {
    private static final List<Biome.SpawnerData> SWAMPHUT_ENEMIES;
    private static final List<Biome.SpawnerData> SWAMPHUT_ANIMALS;
    
    public SwamplandHutFeature(final Codec<NoneFeatureConfiguration> codec) {
        super(codec);
    }
    
    @Override
    public StructureStartFactory<NoneFeatureConfiguration> getStartFactory() {
        return FeatureStart::new;
    }
    
    @Override
    public List<Biome.SpawnerData> getSpecialEnemies() {
        return SwamplandHutFeature.SWAMPHUT_ENEMIES;
    }
    
    @Override
    public List<Biome.SpawnerData> getSpecialAnimals() {
        return SwamplandHutFeature.SWAMPHUT_ANIMALS;
    }
    
    static {
        SWAMPHUT_ENEMIES = Lists.<Biome.SpawnerData>newArrayList(new Biome.SpawnerData(EntityType.WITCH, 1, 1, 1));
        SWAMPHUT_ANIMALS = Lists.<Biome.SpawnerData>newArrayList(new Biome.SpawnerData(EntityType.CAT, 1, 1, 1));
    }
    
    public static class FeatureStart extends StructureStart<NoneFeatureConfiguration> {
        public FeatureStart(final StructureFeature<NoneFeatureConfiguration> cml, final int integer2, final int integer3, final BoundingBox ctd, final int integer5, final long long6) {
            super(cml, integer2, integer3, ctd, integer5, long6);
        }
        
        @Override
        public void generatePieces(final ChunkGenerator cha, final StructureManager cva, final int integer3, final int integer4, final Biome bre, final NoneFeatureConfiguration coa) {
            final SwamplandHutPiece cua8 = new SwamplandHutPiece(this.random, integer3 * 16, integer4 * 16);
            this.pieces.add(cua8);
            this.calculateBoundingBox();
        }
    }
}
