From 2bd3a052e3977b5fc1b9db51b910c82e0cb31102 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 21 Jun 2023 00:05:54 -0500 Subject: [PATCH] Added scroll creative tab --- .../ironsspellbooks/registries/CreativeTabRegistry.java | 8 +++++++- .../resources/assets/irons_spellbooks/lang/en_us.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java index 392708b6a..5fb64ac73 100644 --- a/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java +++ b/src/main/java/io/redspace/ironsspellbooks/registries/CreativeTabRegistry.java @@ -172,6 +172,12 @@ public static void register(IEventBus eventBus) { .withTabsBefore(EQUIPMENT_TAB.getKey()) .build()); + public static final RegistryObject SCROLLS_TAB = TABS.register("spellbook_scrolls", () -> CreativeModeTab.builder() + .title(Component.translatable("itemGroup." + IronsSpellbooks.MODID + ".spellbook_scrolls_tab")) + .icon(() -> new ItemStack(ItemRegistry.SCROLL.get())) + .withTabsBefore(MATERIALS_TAB.getKey()) + .build()); + @SubscribeEvent public static void fillCreativeTabs(final BuildCreativeModeTabContentsEvent event) { if (event.getTab() == BuiltInRegistries.CREATIVE_MODE_TAB.get(CreativeModeTabs.FUNCTIONAL_BLOCKS)) { @@ -182,7 +188,7 @@ public static void fillCreativeTabs(final BuildCreativeModeTabContentsEvent even event.accept(ItemRegistry.ARMOR_PILE_BLOCK_ITEM.get()); } - if (event.getTab() == CreativeModeTabs.searchTab()) { + if (event.getTab() == CreativeModeTabs.searchTab() || event.getTab() == SCROLLS_TAB.get()) { Arrays.stream(SpellType.values()) .filter(spellType -> spellType != SpellType.NONE_SPELL && spellType.isEnabled()) .forEach(spellType -> { diff --git a/src/main/resources/assets/irons_spellbooks/lang/en_us.json b/src/main/resources/assets/irons_spellbooks/lang/en_us.json index 2aac0b229..b80119de9 100644 --- a/src/main/resources/assets/irons_spellbooks/lang/en_us.json +++ b/src/main/resources/assets/irons_spellbooks/lang/en_us.json @@ -595,6 +595,7 @@ "itemGroup.irons_spellbooks.spell_materials_tab": "Iron's Spellbooks Materials", "itemGroup.irons_spellbooks.spell_equipment_tab": "Iron's Spellbooks Equipment", + "itemGroup.irons_spellbooks.spellbook_scrolls_tab": "Iron's Spellbooks Scrolls", "advancements.irons_spellbooks.root.title": "Iron's Spells 'n Spellbooks", "advancements.irons_spellbooks.root.description": "There's more than meets the eye to this world...",