package top.r3944realms.lib39.datagen.provider;

import net.minecraft.data.PackOutput;
import net.minecraft.data.loot.LootTableProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.storage.loot.LootTable;
import net.minecraft.world.level.storage.loot.ValidationContext;
import org.jetbrains.annotations.NotNull;

import java.util.Map;
import java.util.Set;

/**
 * The type Simple loot table provider.
 */
public class SimpleLootTableProvider extends LootTableProvider {
    /**
     * Instantiates a new Simple loot table provider.
     *
     * @param output              the output
     * @param subProvidersWrapper the sub providers wrapper
     */
    public SimpleLootTableProvider(PackOutput output, @NotNull SubProvidersWrapper subProvidersWrapper) {
        super(output, Set.of(), subProvidersWrapper.entries);
    }

    /**
     * Instantiates a new Simple loot table provider.
     *
     * @param output              the output
     * @param requiredTables      the required tables
     * @param subProvidersWrapper the sub providers wrapper
     */
    public SimpleLootTableProvider(PackOutput output, Set<ResourceLocation> requiredTables, @NotNull SubProvidersWrapper subProvidersWrapper) {
        super(output, requiredTables, subProvidersWrapper.entries);
    }

    @Override
    protected void validate(@NotNull Map<ResourceLocation, LootTable> map, @NotNull ValidationContext validationcontext) {
        map.forEach((id, table) -> table.validate(validationcontext));
    }
}
