Skip to content

Commit

Permalink
fix: add books to modonomicon tab by default
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Oct 5, 2024
1 parent b95e066 commit 1e09744
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ public class CreativeModeTabRegistry {

public static void onModifyEntries(CreativeModeTab group, FabricItemGroupEntries entries) {
var tabKey = BuiltInRegistries.CREATIVE_MODE_TAB.getResourceKey(group).get();

BookDataManager.get().getBooks().values().forEach(b -> {
if (tabKey == CreativeModeTabs.SEARCH ||
MODONOMICON == group ||
BuiltInRegistries.CREATIVE_MODE_TAB.get(new ResourceLocation(b.getCreativeTab())) == group) {
if (b.generateBookItem()) {
ItemStack stack = new ItemStack(ItemRegistry.MODONOMICON.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ public static void onCreativeModeTabBuildContents(BuildCreativeModeTabContentsEv
if (tabName == null)
return;

var modonomiconTab = CreativeModeTabRegistry.MODONOMICON.get();

BookDataManager.get().getBooks().values().forEach(b -> {
if (event.getTabKey() == CreativeModeTabs.SEARCH || net.minecraftforge.common.CreativeModeTabRegistry.getTab(new ResourceLocation(b.getCreativeTab())) == event.getTab()) {
if (event.getTabKey() == CreativeModeTabs.SEARCH ||
modonomiconTab == event.getTab() ||
net.minecraftforge.common.CreativeModeTabRegistry.getTab(new ResourceLocation(b.getCreativeTab())) == event.getTab()) {
if (b.generateBookItem()) {
ItemStack stack = new ItemStack(ItemRegistry.MODONOMICON.get());

Expand Down

0 comments on commit 1e09744

Please sign in to comment.