+ Creative TAB

This commit is contained in:
Glitchlabs
2026-06-26 22:32:48 +02:00
parent 96b5ae6ba6
commit f0fd0e4d25
3 changed files with 55 additions and 0 deletions
@@ -1,4 +1,5 @@
{ {
"creativetab.ornamentum.ornamentum": "Ornamentum",
"block.ornamentum.black_glow_stained_glass": "Black Glow Stained Glass", "block.ornamentum.black_glow_stained_glass": "Black Glow Stained Glass",
"block.ornamentum.blue_glow_stained_glass": "Blue Glow Stained Glass", "block.ornamentum.blue_glow_stained_glass": "Blue Glow Stained Glass",
"block.ornamentum.brown_glow_stained_glass": "Brown Glow Stained Glass", "block.ornamentum.brown_glow_stained_glass": "Brown Glow Stained Glass",
@@ -33,6 +33,7 @@ import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.DeferredRegister;
import org.slf4j.Logger; import org.slf4j.Logger;
import ovh.glitchlabs.ornamentum.blocks.ModBlocks; import ovh.glitchlabs.ornamentum.blocks.ModBlocks;
import ovh.glitchlabs.ornamentum.items.ModCreativeModeTabs;
import ovh.glitchlabs.ornamentum.items.ModItems; import ovh.glitchlabs.ornamentum.items.ModItems;
// The value here should match an entry in the META-INF/neoforge.mods.toml file // The value here should match an entry in the META-INF/neoforge.mods.toml file
@@ -50,6 +51,7 @@ public class Ornamentum {
ModBlocks.register(modEventBus); ModBlocks.register(modEventBus);
ModItems.register(modEventBus); ModItems.register(modEventBus);
ModCreativeModeTabs.register(modEventBus);
// Register the commonSetup method for modloading // Register the commonSetup method for modloading
modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::commonSetup);
@@ -0,0 +1,52 @@
package ovh.glitchlabs.ornamentum.items;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredRegister;
import ovh.glitchlabs.ornamentum.Ornamentum;
import ovh.glitchlabs.ornamentum.blocks.ModBlocks;
import java.util.function.Supplier;
public class ModCreativeModeTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TAB =
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Ornamentum.MODID);
public static final Supplier<CreativeModeTab> BISMUTH_ITEMS_TAB = CREATIVE_MODE_TAB.register("ornamentum_items_tab",
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModBlocks.PURPLE_GLOW_STAINED_GLASS.get()))
.title(Component.translatable("creativetab.ornamentum.ornamentum"))
.displayItems((itemDisplayParameters, output) -> {
//glow glass
output.accept(ModBlocks.BLACK_GLOW_STAINED_GLASS);
output.accept(ModBlocks.WHITE_GLOW_STAINED_GLASS);
output.accept(ModBlocks.LIGHT_GRAY_GLOW_STAINED_GLASS);
output.accept(ModBlocks.GRAY_GLOW_STAINED_GLASS);
output.accept(ModBlocks.BLACK_GLOW_STAINED_GLASS);
output.accept(ModBlocks.BROWN_GLOW_STAINED_GLASS);
output.accept(ModBlocks.RED_GLOW_STAINED_GLASS);
output.accept(ModBlocks.ORANGE_GLOW_STAINED_GLASS);
output.accept(ModBlocks.YELLOW_GLOW_STAINED_GLASS);
output.accept(ModBlocks.GREEN_GLOW_STAINED_GLASS);
output.accept(ModBlocks.CYAN_GLOW_STAINED_GLASS);
output.accept(ModBlocks.LIGHT_BLUE_GLOW_STAINED_GLASS);
output.accept(ModBlocks.BLUE_GLOW_STAINED_GLASS);
output.accept(ModBlocks.PURPLE_GLOW_STAINED_GLASS);
output.accept(ModBlocks.MAGENTA_GLOW_STAINED_GLASS);
output.accept(ModBlocks.PINK_GLOW_STAINED_GLASS);
//Grates
output.accept(ModBlocks.IRON_GRATE);
}).build());
public static void register(IEventBus eventBus) {
CREATIVE_MODE_TAB.register(eventBus);
}
}