From c01a62689f41dd26c8d035c9783f7a67848c3650 Mon Sep 17 00:00:00 2001 From: nelle Date: Thu, 19 Dec 2024 01:04:01 -0700 Subject: [PATCH] creative tab entries --- .../nelle/roses_mod/RosesCreativeTab.kt | 44 +++++++++++++++++++ .../observer/nelle/roses_mod/RosesMod.kt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesCreativeTab.kt diff --git a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesCreativeTab.kt b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesCreativeTab.kt new file mode 100644 index 0000000..5b23f46 --- /dev/null +++ b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesCreativeTab.kt @@ -0,0 +1,44 @@ +@file:Suppress( + "ktlint:standard:class-naming", + "ktlint:standard:filename", + "ktlint:standard:no-wildcard-imports", + "ktlint:standard:package-name", +) + +package observer.nelle.roses_mod + +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents +import net.minecraft.item.ItemGroups +import net.minecraft.item.Items + +object RosesCreativeTab { + // CREATIVE TABS + val roseTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.POPPY, + RosesBlocks.roseFlower, + ) + }, + ) + val cyanTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.BLUE_ORCHID, + RosesBlocks.cyanRoseFlower, + ) + }, + ) + val cyanBushTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.ROSE_BUSH, + RosesBlocks.cyanRoseBush, + ) + }, + ) +} diff --git a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt index 8be4a71..4ede53e 100644 --- a/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt +++ b/MC1.20.6/src/main/kotlin/observer/nelle/roses_mod/RosesMod.kt @@ -21,9 +21,9 @@ class roses_mod : ModInitializer { /* TODO: * - register worldgen * - biome modification - * - creative tabs * */ RosesBlocks + RosesCreativeTab } }