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

import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.levelgen.feature.structures.StructurePoolElement;
import net.minecraft.world.level.levelgen.feature.configurations.JigsawConfiguration;
import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece;
import net.minecraft.world.level.levelgen.feature.structures.JigsawPlacement;
import java.util.Random;
import net.minecraft.world.level.levelgen.feature.configurations.MultiJigsawConfiguration;
import net.minecraft.world.level.levelgen.WorldgenRandom;
import net.minecraft.world.level.levelgen.structure.StructurePiece;
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;
import com.google.common.collect.ImmutableMap;

public class BastionPieces {
    public static final ImmutableMap<String, Integer> POOLS;
    
    public static void bootstrap() {
        BastionHousingUnitsPools.bootstrap();
        BastionHoglinStablePools.bootstrap();
        BastionTreasureRoomPools.bootstrap();
        BastionBridgePools.bootstrap();
        BastionSharedPools.bootstrap();
    }
    
    public static void addPieces(final ChunkGenerator cha, final StructureManager cva, final BlockPos fu, final List<StructurePiece> list, final WorldgenRandom ciy, final MultiJigsawConfiguration cnx) {
        bootstrap();
        final JigsawConfiguration cnu7 = cnx.getRandomPool(ciy);
        JigsawPlacement.addPieces(cnu7.startPool, cnu7.size, BastionPiece::new, cha, cva, fu, list, ciy, false, false);
    }
    
    static {
        POOLS = ImmutableMap.<String, Integer>builder().put("bastion/units/base", 60).put("bastion/hoglin_stable/origin", 60).put("bastion/treasure/starters", 60).put("bastion/bridge/start", 60).build();
    }
    
    public static class BastionPiece extends PoolElementStructurePiece {
        public BastionPiece(final StructureManager cva, final StructurePoolElement cqd, final BlockPos fu, final int integer, final Rotation cap, final BoundingBox ctd) {
            super(StructurePieceType.BASTION_REMNANT, cva, cqd, fu, integer, cap, ctd);
        }
        
        public BastionPiece(final StructureManager cva, final CompoundTag le) {
            super(cva, le, StructurePieceType.BASTION_REMNANT);
        }
    }
}
