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

import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.levelgen.feature.structures.EmptyPoolElement;
import net.minecraft.world.level.levelgen.feature.structures.ListPoolElement;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor;
import net.minecraft.world.level.levelgen.structure.templatesystem.BlockRotProcessor;
import net.minecraft.world.level.levelgen.feature.structures.StructurePoolElement;
import net.minecraft.world.level.levelgen.feature.structures.StructureTemplatePool;
import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import net.minecraft.world.level.levelgen.feature.structures.SinglePoolElement;
import java.util.Random;
import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.WorldgenRandom;
import java.util.List;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
import net.minecraft.world.level.chunk.ChunkGenerator;

public class PillagerOutpostPieces {
    public static void addPieces(final ChunkGenerator<?> caa, final StructureManager cmo, final BlockPos fk, final List<StructurePiece> list, final WorldgenRandom ccf) {
        JigsawPlacement.addPieces(new ResourceLocation("pillager_outpost/base_plates"), 7, PillagerOutpostPiece::new, caa, cmo, fk, list, ccf);
    }
    
    static {
        JigsawPlacement.POOLS.register(new StructureTemplatePool(new ResourceLocation("pillager_outpost/base_plates"), new ResourceLocation("empty"), ImmutableList.of(Pair.of(new SinglePoolElement("pillager_outpost/base_plate"), 1)), StructureTemplatePool.Projection.RIGID));
        JigsawPlacement.POOLS.register(new StructureTemplatePool(new ResourceLocation("pillager_outpost/towers"), new ResourceLocation("empty"), ImmutableList.of(Pair.of(new ListPoolElement(ImmutableList.of(new SinglePoolElement("pillager_outpost/watchtower"), new SinglePoolElement("pillager_outpost/watchtower_overgrown", ImmutableList.of(new BlockRotProcessor(0.05f))))), 1)), StructureTemplatePool.Projection.RIGID));
        JigsawPlacement.POOLS.register(new StructureTemplatePool(new ResourceLocation("pillager_outpost/feature_plates"), new ResourceLocation("empty"), ImmutableList.of(Pair.of(new SinglePoolElement("pillager_outpost/feature_plate"), 1)), StructureTemplatePool.Projection.TERRAIN_MATCHING));
        JigsawPlacement.POOLS.register(new StructureTemplatePool(new ResourceLocation("pillager_outpost/features"), new ResourceLocation("empty"), ImmutableList.of(Pair.of(new SinglePoolElement("pillager_outpost/feature_cage1"), 1), Pair.of(new SinglePoolElement("pillager_outpost/feature_cage2"), 1), Pair.of(new SinglePoolElement("pillager_outpost/feature_logs"), 1), Pair.of(new SinglePoolElement("pillager_outpost/feature_tent1"), 1), Pair.of(new SinglePoolElement("pillager_outpost/feature_tent2"), 1), Pair.of(new SinglePoolElement("pillager_outpost/feature_targets"), 1), Pair.of(EmptyPoolElement.INSTANCE, 6)), StructureTemplatePool.Projection.RIGID));
    }
    
    public static class PillagerOutpostPiece extends PoolElementStructurePiece {
        public PillagerOutpostPiece(final StructureManager cmo, final StructurePoolElement cik, final BlockPos fk, final int integer, final Rotation btu, final BoundingBox clb) {
            super(StructurePieceType.PILLAGER_OUTPOST, cmo, cik, fk, integer, btu, clb);
        }
        
        public PillagerOutpostPiece(final StructureManager cmo, final CompoundTag jt) {
            super(cmo, jt, StructurePieceType.PILLAGER_OUTPOST);
        }
    }
}
