From aa30fa2254c30b812c9808e7bb8f6cef02aa0101 Mon Sep 17 00:00:00 2001 From: RuiXuqi <90179819+RuiXuqi@users.noreply.github.com> Date: Sat, 31 Jan 2026 18:07:17 +0800 Subject: [PATCH] Optimize --- .../mrcrayfish/catalogue/client/IModData.java | 6 +- .../client/screen/CatalogueModListScreen.java | 92 +++++++++---------- .../client/screen/MinecraftModData.java | 10 +- .../widget/CatalogueCheckBoxButton.java | 57 ------------ .../client/screen/widget/DropdownMenu.java | 4 +- .../assets/catalogue/lang/zh_cn.json | 36 +++++++- .../catalogue/client/FabricModData.java | 6 -- .../catalogue/client/ForgeModData.java | 16 ++-- .../catalogue/client/ClientCatalogue.java | 21 ----- .../catalogue/client/NeoForgeModData.java | 8 +- 10 files changed, 96 insertions(+), 160 deletions(-) delete mode 100644 common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/CatalogueCheckBoxButton.java delete mode 100644 neoforge/src/main/java/com/mrcrayfish/catalogue/client/ClientCatalogue.java diff --git a/common/src/main/java/com/mrcrayfish/catalogue/client/IModData.java b/common/src/main/java/com/mrcrayfish/catalogue/client/IModData.java index 8d800d7..79e5caa 100644 --- a/common/src/main/java/com/mrcrayfish/catalogue/client/IModData.java +++ b/common/src/main/java/com/mrcrayfish/catalogue/client/IModData.java @@ -58,7 +58,11 @@ public interface IModData boolean isLogoSmooth(); - boolean isLibrary(); + default boolean isLibrary() + { + Type type = this.getType(); + return type == Type.LIBRARY || type == Type.GENERATED; + } void openConfigScreen(Screen parent); diff --git a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/CatalogueModListScreen.java b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/CatalogueModListScreen.java index 24cd264..68b7900 100644 --- a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/CatalogueModListScreen.java +++ b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/CatalogueModListScreen.java @@ -42,6 +42,7 @@ import net.minecraft.resources.Identifier; import net.minecraft.sounds.SoundEvents; import net.minecraft.util.FormattedCharSequence; +import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -162,13 +163,11 @@ public int getInnerWidth() { }; this.searchTextField.addFormatter(this::formatQuery); this.searchTextField.setMaxLength(128); - this.searchTextField.setValue(OPTION_QUERY.getValue()); + this.searchTextField.setValue(OPTION_QUERY.get()); this.searchTextField.setResponder(s -> { - if(!OPTION_QUERY.getValue().equals(s)) { + if(!OPTION_QUERY.get().equals(s)) { OPTION_QUERY.setValue(s); - this.updateSearchFieldSuggestion(s); this.modList.filterAndUpdateList(); - this.updateSelectedModList(); } }); this.addWidget(this.searchTextField); @@ -252,14 +251,12 @@ public int getInnerWidth() { if(this.selectedModData != null) { this.setSelectedModData(this.selectedModData); - this.updateSelectedModList(); - ModListEntry entry = this.modList.getEntryFromInfo(this.selectedModData); + ModListEntry entry = this.modList.getSelected(); if(entry != null) { this.modList.centerScrollOn(entry); } } - this.updateSearchFieldSuggestion(this.searchTextField.getValue()); } /** @@ -289,7 +286,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTi boolean inMenu = this.menu != null; super.render(graphics, inMenu ? -1000 : mouseX, inMenu ? -1000 : mouseY, partialTicks); - if(OPTION_QUERY.getValue().startsWith("@")) + if(OPTION_QUERY.get().startsWith("@")) { int iconX = this.searchTextField.getX() + this.searchTextField.getWidth() - 15; int iconY = this.searchTextField.getY() + (this.searchTextField.getHeight() - 10) / 2; @@ -352,17 +349,9 @@ private void setTooltip(GuiGraphics graphics, Component message, int mouseX, int graphics.setTooltipForNextFrame(this.font.split(message, Math.min(200, this.width)), mouseX, mouseY); } - private void updateSelectedModList() - { - ModListEntry selectedEntry = this.modList.getEntryFromInfo(this.selectedModData); - if(selectedEntry != null) - { - this.modList.setSelected(selectedEntry); - } - } - - private void updateSearchFieldSuggestion(String value) + private void updateSearchFieldSuggestion() { + String value = this.searchTextField.getValue(); if(value.isEmpty()) { this.searchTextField.setSuggestion(Component.translatable("catalogue.gui.search").append(Component.literal("...")).getString()); @@ -395,7 +384,7 @@ else if(value.startsWith("@")) else { Optional optional = CACHED_MODS.values().stream().filter(data -> { - return data.getDisplayName().toLowerCase(Locale.ENGLISH).startsWith(value.toLowerCase(Locale.ENGLISH)); + return ModList.FILTER_PREDICATE.test(data) && data.getDisplayName().toLowerCase(Locale.ENGLISH).startsWith(value.toLowerCase(Locale.ENGLISH)); }).min(Comparator.comparing(IModData::getDisplayName)); if(optional.isPresent()) { @@ -543,21 +532,23 @@ private void drawModInfo(GuiGraphics graphics, int mouseX, int mouseY, float par * @param y the y position * @param maxWidth the maximum width the string can render * @param mouseX the current mouse x position - * @param mouseY the current mouse u position + * @param mouseY the current mouse y position */ private void drawStringWithLabel(GuiGraphics graphics, String format, String text, int x, int y, int maxWidth, int mouseX, int mouseY, ChatFormatting labelColor, ChatFormatting contentColor) { Component formatted = ClientServices.COMPONENT.createFormatted(format, text); String rawString = formatted.getString(); - String label = rawString.substring(0, rawString.indexOf(":") + 1); - String content = rawString.substring(rawString.indexOf(":") + 1); + String colon = rawString.contains(":") ? ":" : ":"; + String label = rawString.substring(0, rawString.indexOf(colon) + 1); + String content = rawString.substring(rawString.indexOf(colon) + 1); if(this.font.width(formatted) > maxWidth) { content = this.font.plainSubstrByWidth(content, maxWidth - this.font.width(label) - 7) + "..."; MutableComponent credits = Component.literal(label).withStyle(labelColor); credits.append(Component.literal(content).withStyle(contentColor)); graphics.drawString(this.font, credits, x, y, 0xFFFFFFFF); - if(ClientHelper.isMouseWithin(x, y, maxWidth, 9, mouseX, mouseY)) // Sets the active tool tip if string is too long so users can still read it + // Sets the active tool tip if string is too long so users can still read it + if(ClientHelper.isMouseWithin(x, y, maxWidth, 9, mouseX, mouseY)) { this.setTooltip(graphics, Component.literal(text), mouseX, mouseY); } @@ -598,6 +589,10 @@ public boolean mouseClicked(MouseButtonEvent event, boolean doubleClick) } } } + if(event.button() == GLFW.GLFW_MOUSE_BUTTON_RIGHT && this.searchTextField.isActive() && this.searchTextField.isHovered()) + { + this.searchTextField.setValue(""); + } return super.mouseClicked(event, doubleClick); } @@ -799,7 +794,7 @@ private void reloadBackground(IModData data) private class ModList extends ObjectSelectionList { private static final Predicate SEARCH_PREDICATE = data -> { - String query = OPTION_QUERY.getValue(); + String query = OPTION_QUERY.get(); if(query.startsWith("@")) { return performSearchFilter(query, data); } @@ -809,7 +804,7 @@ private class ModList extends ObjectSelectionList }; private static final Predicate FILTER_PREDICATE = data -> { // We ignore filters when using special query - String query = OPTION_QUERY.getValue(); + String query = OPTION_QUERY.get(); if(query.startsWith("@")) { return true; } @@ -868,9 +863,15 @@ public void filterAndUpdateList() .filter(SEARCH_PREDICATE) .filter(FILTER_PREDICATE) .map(info -> new ModListEntry(info, this)) - .sorted(OPTION_SORT.getValue()) + .sorted(OPTION_SORT.get()) .collect(Collectors.toList()); this.replaceEntries(entries); + if(CatalogueModListScreen.this.selectedModData != null) + { + Optional selectedEntry = this.children().stream().filter(entry -> entry.data == CatalogueModListScreen.this.selectedModData).findFirst(); + selectedEntry.ifPresent(this::setSelected); + } + CatalogueModListScreen.this.updateSearchFieldSuggestion(); this.refreshScrollAmount(); } @@ -882,12 +883,6 @@ public Optional getChildAt(double mouseX, double mouseY) return super.getChildAt(mouseX, mouseY); } - @Nullable - public ModListEntry getEntryFromInfo(IModData data) - { - return this.children().stream().filter(entry -> entry.data == data).findFirst().orElse(null); - } - @Override public void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) { @@ -976,7 +971,7 @@ private static boolean performSearchFilter(String query, IModData data) private FormattedCharSequence formatQuery(String partial, int displayPos) { - String query = OPTION_QUERY.getValue(); + String query = OPTION_QUERY.get(); if(!query.startsWith("@")) return FormattedCharSequence.forward(partial, Style.EMPTY); @@ -1021,8 +1016,8 @@ public void renderContent(GuiGraphics graphics, int mouseX, int mouseY, boolean // Draws mod name and version boolean inOptionsMenu = CatalogueModListScreen.this.menu != null; boolean drawFavouriteIcon = !inOptionsMenu && !this.list.shouldHideFavourites() && ClientHelper.isMouseWithin(this.getX() + this.getWidth() - this.getHeight() - 4, this.getY(), this.getHeight() + 4, this.getHeight(), mouseX, mouseY) || FAVOURITES.has(this.data.getModId()); - graphics.drawString(CatalogueModListScreen.this.font, this.getFormattedModName(drawFavouriteIcon), this.getX() + 24, this.getY() + 4, 0xFFFFFFFF); - graphics.drawString(CatalogueModListScreen.this.font, Component.literal(this.data.getVersion()).withStyle(ChatFormatting.GRAY), this.getX() + 24, this.getY() + 14, 0xFFFFFFFF); + graphics.drawString(CatalogueModListScreen.this.font, this.getFormattedText(this.data.getDisplayName(), drawFavouriteIcon).withStyle(this.data.getType().getStyle()), this.getX() + 24, this.getY() + 4, 0xFFFFFFFF); + graphics.drawString(CatalogueModListScreen.this.font, this.getFormattedText(this.data.getVersion(), drawFavouriteIcon).withStyle(ChatFormatting.GRAY), this.getX() + 24, this.getY() + 14, 0xFFFFFFFF); // Draw image icon or fallback to item icon this.drawIcon(graphics, this.getX(), this.getY()); @@ -1084,6 +1079,12 @@ private Item getItemIcon() // Put grass as default item icon ITEM_ICON_CACHE.put(this.data.getModId(), Items.GRASS_BLOCK); + // Minecraft is a grass block + if(this.data.getModId().equals("minecraft")) + { + return Items.GRASS_BLOCK; + } + // Special case for Forge to set item icon to anvil if(this.data.getModId().equals("forge")) { @@ -1107,8 +1108,13 @@ private Item getItemIcon() } } + // If the mod has a creative tab, Catalogue will attempt to use the tab's icon + Optional optional = BuiltInRegistries.CREATIVE_MODE_TAB.stream().map(CreativeModeTab::getIconItem).map(ItemStack::getItem).filter(item -> item.builtInRegistryHolder().key().identifier().getNamespace().equals(this.data.getModId())).findFirst(); // If the mod doesn't specify an item to use, Catalogue will attempt to get an item from the mod - Optional optional = BuiltInRegistries.ITEM.stream().filter(item -> item.builtInRegistryHolder().key().identifier().getNamespace().equals(this.data.getModId())).findFirst(); + if(optional.isEmpty()) + { + optional = BuiltInRegistries.ITEM.stream().filter(item -> item.builtInRegistryHolder().key().identifier().getNamespace().equals(this.data.getModId())).findFirst(); + } if(optional.isPresent()) { Item item = optional.get(); @@ -1122,9 +1128,8 @@ private Item getItemIcon() return Items.GRASS_BLOCK; } - private Component getFormattedModName(boolean favouriteIconVisible) + private MutableComponent getFormattedText(String text, boolean favouriteIconVisible) { - String name = this.data.getDisplayName(); int paddingEnd = 4; int trimWidth = this.list.getRowWidth() - 24 - paddingEnd; IModData.Update update = this.data.getUpdate(); @@ -1136,16 +1141,11 @@ private Component getFormattedModName(boolean favouriteIconVisible) { trimWidth -= 18; } - if(CatalogueModListScreen.this.font.width(name) > trimWidth) - { - name = CatalogueModListScreen.this.font.plainSubstrByWidth(name, trimWidth - 8).trim() + "..."; - } - MutableComponent title = Component.literal(name); - if(this.data.isLibrary()) + if(CatalogueModListScreen.this.font.width(text) > trimWidth) { - title.withStyle(ChatFormatting.DARK_GRAY); + text = CatalogueModListScreen.this.font.plainSubstrByWidth(text, trimWidth - 8).trim() + "..."; } - return title; + return Component.literal(text); } @Override diff --git a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/MinecraftModData.java b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/MinecraftModData.java index ca86a4c..528202b 100644 --- a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/MinecraftModData.java +++ b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/MinecraftModData.java @@ -64,7 +64,7 @@ public String getImageIcon() @Override public String getLicense() { - return "All Rights Reserved"; + return "All Rights Reserved (https://www.minecraft.net/en-us/eula)"; } @Nullable @@ -92,7 +92,7 @@ public String getHomepage() @Override public String getIssueTracker() { - return "https://bugs.mojang.com/projects/MC/issues"; + return "https://bugs.mojang.com/browse/MC"; } @Nullable @@ -133,12 +133,6 @@ public boolean isLogoSmooth() return true; } - @Override - public boolean isLibrary() - { - return true; - } - @Override public void openConfigScreen(Screen parent) { diff --git a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/CatalogueCheckBoxButton.java b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/CatalogueCheckBoxButton.java deleted file mode 100644 index 8ff0a98..0000000 --- a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/CatalogueCheckBoxButton.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.mrcrayfish.catalogue.client.screen.widget; - -import com.mrcrayfish.catalogue.Constants; -import net.minecraft.client.gui.GuiGraphics; -import net.minecraft.client.gui.components.AbstractButton; -import net.minecraft.client.gui.narration.NarrationElementOutput; -import net.minecraft.client.input.InputWithModifiers; -import net.minecraft.client.renderer.RenderPipelines; -import net.minecraft.network.chat.CommonComponents; -import net.minecraft.resources.Identifier; - -/** - * Author: MrCrayfish - */ -public class CatalogueCheckBoxButton extends AbstractButton -{ - private static final Identifier TEXTURE = Identifier.fromNamespaceAndPath(Constants.MOD_ID, "textures/gui/checkbox.png"); - - private final OnPress onPress; - private boolean selected; - - public CatalogueCheckBoxButton(int x, int y, OnPress onPress) - { - super(x, y, 14, 14, CommonComponents.EMPTY); - this.onPress = onPress; - } - - public boolean isSelected() - { - return this.selected; - } - - @Override - public void onPress(InputWithModifiers modifiers) - { - this.selected = !this.selected; - this.onPress.onPress(this); - } - - @Override - public void renderContents(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - { - this.renderDefaultSprite(graphics); - graphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, this.getX(), this.getY(), this.isHoveredOrFocused() ? 14 : 0, this.isSelected() ? 14 : 0, 14, 14, 64, 64); - } - - @Override - protected void updateWidgetNarration(NarrationElementOutput output) - { - - } - - public interface OnPress - { - void onPress(CatalogueCheckBoxButton button); - } -} diff --git a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/DropdownMenu.java b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/DropdownMenu.java index 4f48c68..f1b7161 100644 --- a/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/DropdownMenu.java +++ b/common/src/main/java/com/mrcrayfish/catalogue/client/screen/widget/DropdownMenu.java @@ -237,13 +237,13 @@ protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float { super.renderWidget(graphics, mouseX, mouseY, deltaTick); int offset = (this.getHeight() - 14) / 2; - graphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, this.getX() + this.getWidth() - 14 - offset, this.getY() + offset, this.isHoveredOrFocused() ? 14 : 0, this.holder.getValue() ? 14 : 0, 14, 14, 64, 64); + graphics.blit(RenderPipelines.GUI_TEXTURED, TEXTURE, this.getX() + this.getWidth() - 14 - offset, this.getY() + offset, this.isHoveredOrFocused() ? 14 : 0, this.holder.get() ? 14 : 0, 14, 14, 64, 64); } @Override public void onClick(MouseButtonEvent event, boolean doubleClick) { - boolean newValue = !this.holder.getValue(); + boolean newValue = !this.holder.get(); this.holder.setValue(newValue); if(this.callback.apply(newValue)) { diff --git a/common/src/main/resources/assets/catalogue/lang/zh_cn.json b/common/src/main/resources/assets/catalogue/lang/zh_cn.json index 0be7a9f..c42cf79 100644 --- a/common/src/main/resources/assets/catalogue/lang/zh_cn.json +++ b/common/src/main/resources/assets/catalogue/lang/zh_cn.json @@ -1,4 +1,34 @@ { - "catalogue.gui.no_selection": "没有选择模组...", - "catalogue.gui.info": "此菜单由 Catalogue 重新设计。单击此处打开此模组的 CurseForge 页面!" -} + "catalogue.gui.no_selection": "没有选择模组……", + "catalogue.gui.mod_list": "模组", + "catalogue.gui.search": "搜索", + "catalogue.gui.config": "配置", + "catalogue.gui.website": "网站", + "catalogue.gui.submit_bug": "提交Bug", + "catalogue.gui.open_mods_folder": "打开模组文件夹", + "catalogue.gui.licenses": "许可协议:%s", + "catalogue.gui.authors": "作者:%s", + "catalogue.gui.contributors": "贡献者:%s", + "catalogue.gui.credits": "致谢:%s", + "catalogue.gui.version": "版本:%s", + "catalogue.gui.update_available": "更新:%s", + "catalogue.gui.info": "此菜单由Catalogue提供。单击此处打开此模组的CurseForge页面!", + "catalogue.gui.favourite": "标记为收藏", + "catalogue.gui.remove_favourite": "取消收藏", + "catalogue.gui.options": "选项", + "catalogue.gui.filters": "筛选", + "catalogue.gui.filters.configs_only": "仅显示有配置的模组", + "catalogue.gui.filters.updates_only": "仅显示有更新的模组", + "catalogue.gui.filters.favourites": "仅显示收藏", + "catalogue.gui.sort": "排序", + "catalogue.gui.sort.alphabetically": "A到Z", + "catalogue.gui.sort.alphabetically_reverse": "Z到A", + "catalogue.gui.sort.favourites_first": "收藏优先", + "catalogue.gui.hide_libraries": "隐藏库模组", + "catalogue.gui.no_mods": "没有模组……", + "catalogue.gui.mod_count": "%s个模组", + "catalogue.gui.library_count": "%s个库", + "catalogue.gui.advanced_search.info": "高级搜索查询将忽略任何激活的筛选器", + "catalogue.gui.show_dependencies": "显示前置模组", + "catalogue.gui.show_dependents": "显示依赖模组" +} \ No newline at end of file diff --git a/fabric/src/main/java/com/mrcrayfish/catalogue/client/FabricModData.java b/fabric/src/main/java/com/mrcrayfish/catalogue/client/FabricModData.java index 87c98de..48d73bb 100644 --- a/fabric/src/main/java/com/mrcrayfish/catalogue/client/FabricModData.java +++ b/fabric/src/main/java/com/mrcrayfish/catalogue/client/FabricModData.java @@ -193,12 +193,6 @@ public boolean isLogoSmooth() return false; } - @Override - public boolean isLibrary() - { - return this.type == LIBRARY || this.type == GENERATED; - } - @Override public void openConfigScreen(Screen parent) { diff --git a/forge/src/main/java/com/mrcrayfish/catalogue/client/ForgeModData.java b/forge/src/main/java/com/mrcrayfish/catalogue/client/ForgeModData.java index 2406280..5f05754 100644 --- a/forge/src/main/java/com/mrcrayfish/catalogue/client/ForgeModData.java +++ b/forge/src/main/java/com/mrcrayfish/catalogue/client/ForgeModData.java @@ -30,7 +30,7 @@ public ForgeModData(IModInfo info) { this.info = info; this.type = analyzeType(info); - this.dependencies = this.analyzeDependencies(info); + this.dependencies = analyzeDependencies(info); } @Override @@ -159,12 +159,6 @@ public boolean isLogoSmooth() return this.info.getLogoBlur(); } - @Override - public boolean isLibrary() - { - return this.info.getModId().equals("forge") || this.type != Type.DEFAULT; - } - @Override public void openConfigScreen(Screen parent) { @@ -184,8 +178,12 @@ private String getConfigString(String key) return ((ModInfo) this.info).getConfigElement(key).map(Object::toString).orElse(null); } - private Type analyzeType(IModInfo info) + private static Type analyzeType(IModInfo info) { + if(info.getModId().equals("forge")) + { + return Type.LIBRARY; + } return switch(info.getOwningFile().getFile().getType()) { case MOD -> Type.DEFAULT; @@ -193,7 +191,7 @@ private Type analyzeType(IModInfo info) }; } - private Set analyzeDependencies(IModInfo source) + private static Set analyzeDependencies(IModInfo source) { List versions = source.getDependencies(); return versions.stream().filter(version -> { diff --git a/neoforge/src/main/java/com/mrcrayfish/catalogue/client/ClientCatalogue.java b/neoforge/src/main/java/com/mrcrayfish/catalogue/client/ClientCatalogue.java deleted file mode 100644 index 23f0008..0000000 --- a/neoforge/src/main/java/com/mrcrayfish/catalogue/client/ClientCatalogue.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.mrcrayfish.catalogue.client; - -import com.mrcrayfish.catalogue.Constants; -import net.neoforged.api.distmarker.Dist; -import net.neoforged.bus.api.SubscribeEvent; -import net.neoforged.fml.common.EventBusSubscriber; -import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; -import net.neoforged.fml.loading.FMLPaths; - -/** - * Author: MrCrayfish - */ -@EventBusSubscriber(modid = Constants.MOD_ID, value = Dist.CLIENT) -public class ClientCatalogue -{ - @SubscribeEvent - private static void onClientSetup(FMLClientSetupEvent event) - { - Config.load(FMLPaths.CONFIGDIR.get()); - } -} diff --git a/neoforge/src/main/java/com/mrcrayfish/catalogue/client/NeoForgeModData.java b/neoforge/src/main/java/com/mrcrayfish/catalogue/client/NeoForgeModData.java index b9f81ad..3b15f42 100644 --- a/neoforge/src/main/java/com/mrcrayfish/catalogue/client/NeoForgeModData.java +++ b/neoforge/src/main/java/com/mrcrayfish/catalogue/client/NeoForgeModData.java @@ -170,12 +170,6 @@ public boolean isLogoSmooth() return this.info.getLogoBlur(); } - @Override - public boolean isLibrary() - { - return this.info.getModId().equals("neoforge") || this.type != Type.DEFAULT; - } - @Override public void openConfigScreen(Screen parent) { @@ -203,7 +197,7 @@ private static Type analyzeType(IModInfo info) { // For Fabric libraries loaded by Sinytra Connector String modId = info.getModId(); - if(modId.startsWith("fabric-") || modId.equals("fabricloader") || modId.equals("mixinextras")) + if(modId.equals("neoforge") || modId.startsWith("fabric-") || modId.equals("fabricloader") || modId.equals("mixinextras")) { return Type.LIBRARY; }