
/*
 *    MCreator note: This file will be REGENERATED on each build.
 */
package net.mcreator.customoregen.init;

import net.neoforged.neoforge.registries.DeferredRegister;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;

import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;

import net.mcreator.customoregen.CustomOreGenMod;

import java.util.function.Supplier;

@EventBusSubscriber(modid = CustomOreGenMod.MODID, bus = EventBusSubscriber.Bus.GAME)
public class CustomOreGenModTabs {
	public static final DeferredRegister<CreativeModeTab> REGISTRY = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, CustomOreGenMod.MODID);

	// Start of user code block tabs
	public static final Supplier<CreativeModeTab> CUSTOM_ORE_GEN_TAB = REGISTRY.register("custom_ore_gen_tab",
			() -> CreativeModeTab.builder()
					.title(Component.translatable("itemGroup.custom_ore_gen"))
					.icon(() -> new ItemStack(CustomOreGenModItems.DIAMONDSHARD.get()))
					.displayItems((parameters, output) -> {
						// Minerais
						output.accept(CustomOreGenModBlocks.DEEPSLATESHARDDIAMONDORE.get().asItem());
						output.accept(CustomOreGenModBlocks.DEEPSLATEDIAMONDORE.get().asItem());
						output.accept(CustomOreGenModBlocks.PUREGOLDENORE.get().asItem());
						output.accept(CustomOreGenModBlocks.DEEPSLATEPUREGOLDENORE.get().asItem());
						output.accept(CustomOreGenModBlocks.CONCENTRATEDCOALORE.get().asItem());
						output.accept(CustomOreGenModBlocks.IRONORE.get().asItem());
						output.accept(CustomOreGenModBlocks.DEEPSLATEIRONORE.get().asItem());
						output.accept(CustomOreGenModBlocks.LAPISORE.get().asItem());
						output.accept(CustomOreGenModBlocks.DEEPSLATELAPISORE.get().asItem());
						output.accept(CustomOreGenModBlocks.REDSTONEORE.get().asItem());
						output.accept(CustomOreGenModBlocks.DEEPSLATEREDSTONEORE.get().asItem());
						output.accept(CustomOreGenModBlocks.COPPERHIGHORE.get().asItem());
						output.accept(CustomOreGenModBlocks.COPPERLOWERORE.get().asItem());
						output.accept(CustomOreGenModBlocks.HIGHEMERALDORE.get().asItem());
						output.accept(CustomOreGenModBlocks.LOWEREMERALDORE.get().asItem());

						// Items
						output.accept(CustomOreGenModItems.DIAMONDSHARD.get());
						output.accept(CustomOreGenModItems.ORE_BIOME_FINDER.get());

						// Outils
						output.accept(CustomOreGenModItems.SHARDDIAMONDPICKAXE.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDSHOVEL.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDAXE.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDPAXEL.get());

						// Armure
						output.accept(CustomOreGenModItems.SHARDDIAMONDHELMET.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDCHESTPLATE.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDLEGGINGS.get());
						output.accept(CustomOreGenModItems.SHARDDIAMONDBOOTS.get());
					})
					.build());
	// End of user code block tabs

	@SubscribeEvent
	public static void buildTabContentsVanilla(BuildCreativeModeTabContentsEvent tabData) {
		if (tabData.getTabKey() == CreativeModeTabs.INGREDIENTS) {
			tabData.accept(CustomOreGenModItems.DIAMONDSHARD.get());
			tabData.accept(CustomOreGenModBlocks.DEEPSLATESHARDDIAMONDORE.get().asItem());
		} else if (tabData.getTabKey() == CreativeModeTabs.TOOLS_AND_UTILITIES) {
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDPICKAXE.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDSHOVEL.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDAXE.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDPAXEL.get());
			tabData.accept(CustomOreGenModItems.ORE_BIOME_FINDER.get());
		} else if (tabData.getTabKey() == CreativeModeTabs.COMBAT) {
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDHELMET.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDCHESTPLATE.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDLEGGINGS.get());
			tabData.accept(CustomOreGenModItems.SHARDDIAMONDBOOTS.get());
		}
	}
}
