package com.r3944realms.modernlifepatch.datagen.provider.loot;

import com.r3944realms.modernlifepatch.content.blocks.ModBlocks;
import net.minecraft.data.loot.BlockLootSubProvider;
import net.minecraft.world.flag.FeatureFlags;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.registries.RegistryObject;
import org.jetbrains.annotations.NotNull;

import java.util.Set;

public class ModBlockLootTables extends BlockLootSubProvider {

    public ModBlockLootTables() {
        super(Set.of(), FeatureFlags.REGISTRY.allFlags());
    }


    @Override
    protected void generate() {
        this.dropSelf(ModBlocks.MIRROR.get());
        this.dropSelf(ModBlocks.TALL_MIRROR.get());
        this.dropSelf(ModBlocks.LARGE_MIRROR.get());
        this.dropSelf(ModBlocks.MASSIVE_MIRROR.get());
        this.dropSelf(ModBlocks.WHITE_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.ORANGE_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.MAGENTA_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.LIGHT_BLUE_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.YELLOW_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.LIME_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.PINK_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.GRAY_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.LIGHT_GRAY_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.CYAN_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.PURPLE_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.BLUE_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.BROWN_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.GREEN_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.RED_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.BLACK_CONCRETE_BARRIER.get());
        this.dropSelf(ModBlocks.NULL_BLOCK.get());
        this.dropSelf(ModBlocks.ONE_BLOCK.get());
        this.dropSelf(ModBlocks.TWO_BLOCK.get());
        this.dropSelf(ModBlocks.THREE_BLOCK.get());
        this.dropSelf(ModBlocks.FOUR_BLOCK.get());
        this.dropSelf(ModBlocks.FIVE_BLOCK.get());
        this.dropSelf(ModBlocks.SIX_BLOCK.get());
        this.dropSelf(ModBlocks.SEVEN_BLOCK.get());
        this.dropSelf(ModBlocks.EIGHT_BLOCK.get());
        this.dropSelf(ModBlocks.NINE_BLOCK.get());
        this.dropSelf(ModBlocks.ZERO_BLOCK.get());
    }

    @Override
    protected @NotNull Iterable<Block> getKnownBlocks() {
        return ModBlocks.getEntries().stream().map(RegistryObject::get)::iterator;
    }
}
