package net.yyc12345.teyvatcraft.init;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;

import net.minecraft.item.Item;
import net.yyc12345.teyvatcraft.mixin.VillagerAccess;

public class VillagerManager {

    public static void RegisterAll() {
        // register villager food
        ImmutableMap.Builder<Item, Integer> villagerFoodItems = new ImmutableMap.Builder<Item, Integer>().putAll(VillagerAccess.getItemFoodValues());
        villagerFoodItems.put(ItemsManager.RICE, ItemsManager.RICE.getFoodComponent().getHunger());
        villagerFoodItems.put(ItemsManager.TOMATO, ItemsManager.TOMATO.getFoodComponent().getHunger());
        villagerFoodItems.put(ItemsManager.ONION, ItemsManager.ONION.getFoodComponent().getHunger());
        villagerFoodItems.put(ItemsManager.CABBAGE, ItemsManager.CABBAGE.getFoodComponent().getHunger());
        villagerFoodItems.put(ItemsManager.RADISH, ItemsManager.RADISH.getFoodComponent().getHunger());
        VillagerAccess.setItemFoodValues(villagerFoodItems.build());

        // register villager gatherables
        ImmutableSet.Builder<Item> villagerGatherables= new ImmutableSet.Builder<Item>().addAll(VillagerAccess.getGatherableItems());
        villagerGatherables.add(ItemsManager.RICE);
        villagerGatherables.add(ItemsManager.TOMATO);
        villagerGatherables.add(ItemsManager.ONION);
        villagerGatherables.add(ItemsManager.CABBAGE);
        villagerGatherables.add(ItemsManager.RADISH);
        VillagerAccess.setGatherableItems(villagerGatherables.build());

    }
}
