diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java index 8a9335365..4a177b0ce 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java @@ -208,6 +208,10 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP : i18n("curse.category." + category); } + protected boolean shouldDisplayCategory(String category) { + return !"minecraft".equals(category); + } + private String getLocalizedCategoryIndent(ModDownloadListPageSkin.CategoryIndented category) { return StringUtils.repeats(' ', category.indent * 4) + (category.getCategory() == null @@ -556,9 +560,10 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : dataItem.getTitle()); content.setSubtitle(dataItem.getDescription()); content.getTags().clear(); - dataItem.getCategories().stream() - .map(category -> getSkinnable().getLocalizedCategory(category)) - .forEach(content::addTag); + for (String category : dataItem.getCategories()) { + if (getSkinnable().shouldDisplayCategory(category)) + content.addTag(getSkinnable().getLocalizedCategory(category)); + } loadIcon(dataItem); } diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java index ed424c9ce..7b9e3ba36 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java @@ -357,9 +357,10 @@ public class DownloadPage extends Control implements DecoratorPage { ModTranslations.Mod mod = ModTranslations.getTranslationsByRepositoryType(page.repository.getType()).getModByCurseForgeId(addon.getSlug()); content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : addon.getTitle()); content.setSubtitle(addon.getDescription()); - addon.getCategories().stream() - .map(page::getLocalizedCategory) - .forEach(content::addTag); + for (String category : addon.getCategories()) { + if (page.shouldDisplayCategory(category)) + content.addTag(page.getLocalizedCategory(category)); + } if (StringUtils.isNotBlank(addon.getIconUrl())) { imageView.imageProperty().bind(FXUtils.newRemoteImage(addon.getIconUrl(), 80, 80, true, true)); }