package info.u_team.u_team_core.data;

import java.nio.file.Path;
import java.util.function.Function;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.tags.ITag;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;

public abstract class CommonItemTagsProvider extends CommonTagsProvider<Item> {
	
	private final Function<ITag.INamedTag<Block>, ITag.Builder> blockTagBuilderFunction;
	
	@SuppressWarnings("deprecation")
	public CommonItemTagsProvider(GenerationData data, CommonBlockTagsProvider blockProvider) {
		super(data, Registry.ITEM);
		this.blockTagBuilderFunction = blockProvider::getTagBuilder;
	}
	
	@Override
	protected Path makePath(ResourceLocation location) {
		return resolveData(location).resolve("tags").resolve("items").resolve(location.getPath() + ".json");
	}
	
	@Override
	public String getName() {
		return "Item-Tags";
	}
	
	protected void copy(ITag.INamedTag<Block> blockTag, ITag.INamedTag<Item> itemTag) {
		final ITag.Builder itemTagBuilder = getTagBuilder(itemTag);
		final ITag.Builder blockTagBuilder = blockTagBuilderFunction.apply(blockTag);
		blockTagBuilder.func_232962_b_().forEach(itemTagBuilder::func_232954_a_);
	}
}

@@ -454,16 +454,187 @@
 tion;%0A%09%0A
+%09public CommonItemTagsProvider(GenerationData data) %7B%0A%09%09this(data, new CommonBlockTagsProvider(data) %7B%0A%09%09%09%0A%09%09%09@Override%0A%09%09%09protected void registerTags() %7B%0A%09%09%09%7D%0A%09%09%7D);%0A%09%7D%0A%09%0A
 %09@Suppre

Add basic ctor without a block tags provider for mods that do not have a block tags provider