package top.r3944realms.lib39.core.register;

import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.Item;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import top.r3944realms.lib39.Lib39;
import top.r3944realms.lib39.content.item.DollItem;

import java.util.function.Supplier;

/**
 * The type Ex lib 39 items.
 */
public class FabricLib39Items {
    /**
     * Init.
     */
    public static void init() {
        Lib39Items.DOLL = register("doll", new DollItem(new Item.Properties()));
    }

    /**
     * Register @ not null supplier.
     *
     * @param <T>  the type parameter
     * @param path the path
     * @param item the item
     * @return the @ not null supplier
     */
    @Contract(pure = true)
    public static <T extends Item> @NotNull Supplier<T> register(String path, T item) {
        T register = Registry.register(BuiltInRegistries.ITEM, Lib39.rl(path), item);
        return () -> register;
    }
}
