package top.r3944realms.lib39.base.datagen.provider;

import net.minecraft.data.PackOutput;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.model.generators.BlockModelProvider;
import net.minecraftforge.common.data.ExistingFileHelper;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.util.PlantHelper;

/**
 * The type Lib 39 block model provider.
 */
public class Lib39BlockModelProvider extends BlockModelProvider {
    /**
     * Instantiates a new Lib 39 block model provider.
     *
     * @param output             the output
     * @param existingFileHelper the existing file helper
     */
    public Lib39BlockModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
        super(output, Lib39.MOD_ID, existingFileHelper);
    }

    @Override
    protected void registerModels() {
//        registerPlants();
    }

    /**
     * Register plants.
     */
    protected void registerPlants() {
        for (PlantHelper.Plant plant: PlantHelper.Plant.values()) {
            createPlantsModel(plant);
        }
    }
    private void createPlantsModel(PlantHelper.Plant plant) {
        ResourceLocation rl = PlantHelper.getTextureRL(plant);
        getBuilder("block/doll_item/" + plant)
                .parent(getExistingFile(Lib39.rl("block/base_doll_item")))
                .texture("item", rl)
                .ao(false);
    }
}
