From c1b089783e8090800efef1882915496278256eeb Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sat, 26 Sep 2026 21:42:55 +0300 Subject: [PATCH 01/13] Make hardcoded text translatable --- .../java/io/github/prospector/modmenu/gui/ModListScreen.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index c5ce372d..6f390839 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -186,8 +186,8 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) { this.buttons.add(configureButton); this.buttons.add(websiteButton); this.buttons.add(issuesButton); - this.buttons.add(ButtonUtil.createButton(MODS_FOLDER_BUTTON_ID, this.width / 2 - 154, this.height - 28, 150, 20, "Open Mods Folder")); - this.buttons.add(ButtonUtil.createButton(DONE_BUTTON_ID, this.width / 2 + 4, this.height - 28, 150, 20, "Done")); + this.buttons.add(ButtonUtil.createButton(MODS_FOLDER_BUTTON_ID, this.width / 2 - 154, this.height - 28, 150, 20, I18n.getInstance().translateKey("modmenu.modsFolder"))); + this.buttons.add(ButtonUtil.createButton(DONE_BUTTON_ID, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getInstance().translateKey("modmenu.done"))); this.searchBox.setFocused(true); init = true; From 47dee80b7a508fc8e12a182aa5f937d3183f30f4 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:57:16 +0300 Subject: [PATCH 02/13] Update ModListScreen.java --- .../prospector/modmenu/gui/ModListScreen.java | 65 +++++++++++-------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index 6f390839..07366dc3 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -253,9 +253,9 @@ public ModListWidget getModList() { @Override public void keyPressed(char char_1, int int_1, int mouseX, int mouseY) { this.searchBox.textboxKeyTyped(char_1, int_1); - if (int_1 == 1) { - this.mc.displayScreen(this.parent); - } + if (int_1 == 1) { + this.mc.displayScreen(this.parent); + } modList.keyPressed(int_1, 0, 0); descriptionListWidget.keyPressed(int_1, 0, 0); } @@ -275,12 +275,23 @@ public void mouseReleased(int mouseX, int mouseY, int mouseButton) { descriptionListWidget.mouseReleased(mouseX, mouseY, mouseButton); } } - + @Override public void render(int mouseX, int mouseY, float delta) { I18n i18n = I18n.getInstance(); - int mouseDX = Mouse.getEventDX() * this.width / this.mc.resolution.getScaledWidthScreenCoords(); // field_6326_c - int mouseDY = this.height - Mouse.getEventDY() * this.height / this.mc.resolution.getScaledHeightScreenCoords() - 1; // field_6325_d + + int dWheel = Mouse.getDWheel(); + if (dWheel != 0) { + double scrollDelta = dWheel > 0 ? 1.0 : -1.0; + if (this.modList != null && this.modList.isMouseOver(mouseX, mouseY)) { + this.modList.mouseScrolled(mouseX, mouseY, scrollDelta); + } else if (this.descriptionListWidget != null && this.descriptionListWidget.isMouseOver(mouseX, mouseY)) { + this.descriptionListWidget.mouseScrolled(mouseX, mouseY, scrollDelta); + } + } + + int mouseDX = Mouse.getDX() * this.width / this.mc.resolution.getScaledWidthScreenCoords(); // field_6326_c + int mouseDY = Mouse.getDY() * this.height / this.mc.resolution.getScaledHeightScreenCoords(); // field_6325_d for (int button = 0; button < Mouse.getButtonCount(); button++) { if (Mouse.isButtonDown(button)) { modList.mouseDragged(mouseX, mouseY, button, mouseDX, mouseDY); @@ -318,8 +329,8 @@ public void render(int mouseX, int mouseY, float delta) { GLRenderer.setColor4f(1, 1, 1, 1); this.selected.bindIconTexture(); - ModListEntry.internalRender(paneY, x); - int lineSpacing = 9 + 1; + ModListEntry.internalRender(paneY, x); + int lineSpacing = 9 + 1; int imageOffset = 36; String name = metadata.getName(); if (name.equals("Minecraft")){ // BAD CODE @@ -328,8 +339,8 @@ public void render(int mouseX, int mouseY, float delta) { name = HardcodedUtil.formatFabricModuleName(name); String trimmedName = name; int maxNameWidth = this.width - (x + imageOffset); - trimmedName = getString(font, name, trimmedName, maxNameWidth); - this.drawStringNoShadow(font, trimmedName, x + imageOffset, paneY + 1, 0xFFFFFF); + trimmedName = getString(font, name, trimmedName, maxNameWidth); + this.drawStringNoShadow(font, trimmedName, x + imageOffset, paneY + 1, 0xFFFFFF); if (mouseX > x + imageOffset && mouseY > paneY + 1 && mouseY < paneY + 1 + 9 && mouseX < x + imageOffset + fontRenderer.stringWidth(trimmedName)) { setTooltip(i18n.translateKeyAndFormat("modmenu.modIdToolTip", metadata.getId())); } @@ -349,10 +360,10 @@ public void render(int mouseX, int mouseY, float delta) { List names = new ArrayList<>(); metadata.getAuthors().stream() - .filter(Objects::nonNull) - .map(Person::getName) - .filter(Objects::nonNull) - .forEach(names::add); + .filter(Objects::nonNull) + .map(Person::getName) + .filter(Objects::nonNull) + .forEach(names::add); if (!names.isEmpty()) { if (names.size() > 1) { @@ -372,19 +383,19 @@ public void render(int mouseX, int mouseY, float delta) { GLRenderer.popFrame(); } - static String getString(FontRenderer fontRenderer, String name, String trimmedName, int maxNameWidth) { - if (fontRenderer.stringWidth(name) > maxNameWidth) { - int maxWidth = maxNameWidth - fontRenderer.stringWidth("..."); - trimmedName = ""; - while (fontRenderer.stringWidth(trimmedName) < maxWidth && trimmedName.length() < name.length()) { - trimmedName += name.charAt(trimmedName.length()); - } - trimmedName = trimmedName.isEmpty() ? "..." : trimmedName.substring(0, trimmedName.length() - 1) + "..."; - } - return trimmedName; - } - - public void overlayBackground(int x1, int y1, int x2, int y2, int red, int green, int blue, int startAlpha, int endAlpha) { + static String getString(FontRenderer fontRenderer, String name, String trimmedName, int maxNameWidth) { + if (fontRenderer.stringWidth(name) > maxNameWidth) { + int maxWidth = maxNameWidth - fontRenderer.stringWidth("..."); + trimmedName = ""; + while (fontRenderer.stringWidth(trimmedName) < maxWidth && trimmedName.length() < name.length()) { + trimmedName += name.charAt(trimmedName.length()); + } + trimmedName = trimmedName.isEmpty() ? "..." : trimmedName.substring(0, trimmedName.length() - 1) + "..."; + } + return trimmedName; + } + + public void overlayBackground(int x1, int y1, int x2, int y2, int red, int green, int blue, int startAlpha, int endAlpha) { GLRenderer.pushFrame(); GLRenderer.setShader(Shaders.INTERFACE); From ac46e10aeac6f10ed263b4e5c3229b376fcbb523 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:58:57 +0300 Subject: [PATCH 03/13] Update ModListWidget.java --- .../prospector/modmenu/gui/ModListWidget.java | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java index 0b2dbc52..eeeee233 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListWidget.java @@ -239,25 +239,34 @@ public void mouseClicked(int double_1, int double_2, int int_1) { if (this.isMouseOver(double_1, double_2)) { ModListEntry entry = this.getEntryAtPos(double_1, double_2); if (entry != null) { - if (entry.list.getFocused() != null) { - if (!entry.list.getFocused().equals(entry)) { - this.setFocused(entry); - this.setSelected(entry); - this.setDragging(true); - super.mouseClicked(double_1, double_2, int_1); - } - } else { - this.setFocused(entry); - this.setSelected(entry); - this.setDragging(true); - super.mouseClicked(double_1, double_2, int_1); - } + if (entry.list.getFocused() != null) { + if (!entry.list.getFocused().equals(entry)) { + this.setFocused(entry); + this.setSelected(entry); + this.setDragging(true); + super.mouseClicked(double_1, double_2, int_1); + } + } else { + this.setFocused(entry); + this.setSelected(entry); + this.setDragging(true); + super.mouseClicked(double_1, double_2, int_1); + } } else if (int_1 == 0) { this.clickedHeader((int) (double_1 - (double) (this.left + this.width / 2 - this.getRowWidth() / 2)), (int) (double_2 - (double) this.top) + (int) this.getScrollAmount() - 4); } } } + @Override + public boolean mouseScrolled(double mouseX, double mouseY, double scrollDelta) { + if (this.isMouseOver(mouseX, mouseY)) { + setScrollAmount(getScrollAmount() - scrollDelta * 20.0); + return true; + } + return false; + } + public final ModListEntry getEntryAtPos(double x, double y) { int int_5 = MathHelper.floor(y - (double) this.top) - this.headerHeight + (int) this.getScrollAmount() - 4; // convertToBlockCoord int index = int_5 / this.itemHeight; From 5cc4e9b42b0ab9ef91ef381711a5979a06728cfb Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:59:42 +0300 Subject: [PATCH 04/13] Update EntryListWidget.java --- .../modmenu/gui/EntryListWidget.java | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java index 4dfdb578..828c1c16 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/EntryListWidget.java @@ -39,7 +39,7 @@ public abstract class EntryListWidget> extend protected boolean renderSelection = true; protected boolean renderHeader; protected int headerHeight; - private boolean scrolling; + protected boolean scrolling; private E selected; private E focused; @@ -168,7 +168,6 @@ protected void renderDecorations(int i, int j) { } public void render(int i, int j, float f) { - oldY = j; this.renderBackground(); int k = this.getScrollbarPosition(); int l = k + 6; @@ -321,25 +320,25 @@ protected int getScrollbarPosition() { return this.width / 2 + 124; } - @Override + @Override public void mouseClicked(int d, int e, int i) { this.updateScrollingState(d, e, i); if (this.isMouseOver(d, e)) { E entry = this.getEntryAtPosition(d, e); if (entry != null) { - if (entry.list.getFocused() != null) { - if (!entry.list.getFocused().equals(entry)) { - this.focused = entry; - this.selected = entry; - this.dragging = true; - super.mouseClicked(d, e, i); - } - } else { - this.focused = entry; - this.selected = entry; - this.dragging = true; - super.mouseClicked(d, e, i); - } + if (entry.list.getFocused() != null) { + if (!entry.list.getFocused().equals(entry)) { + this.focused = entry; + this.selected = entry; + this.dragging = true; + super.mouseClicked(d, e, i); + } + } else { + this.focused = entry; + this.selected = entry; + this.dragging = true; + super.mouseClicked(d, e, i); + } } else if (i == 0) { this.clickedHeader((int)(d - (double)(this.left + this.width / 2 - this.getRowWidth() / 2)), (int)(e - (double)this.top) + (int)this.getScrollAmount() - 4); } @@ -353,14 +352,12 @@ public boolean mouseReleased(double d, double e, int i) { return false; } - double oldY = -1; public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double mouseDX, double mouseDY) { - if (mouseButton == 0 && isMouseOver(mouseX, mouseY)) { - setScrollAmount(getScrollAmount() - mouseY + oldY); + if (this.scrolling) { + setScrollAmount(getScrollAmount() - mouseDY); return true; - } else { - return false; } + return false; } public boolean mouseScrolled(double d, double e, double f) { From 454d3343063982b2dc8b04e02145e34931dc549f Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 15:58:13 +0300 Subject: [PATCH 05/13] Update DescriptionListWidget.java --- .../modmenu/gui/DescriptionListWidget.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java index 24d758de..97ee2717 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java @@ -44,11 +44,20 @@ public void render(int mouseX, int mouseY, float delta) { lastSelected = selectedEntry; clearEntries(); setScrollAmount(-Double.MAX_VALUE); - String description = lastSelected.getMetadata().getDescription(); - String id = lastSelected.getMetadata().getId(); - Collection authors = lastSelected.getMetadata().getAuthors(); - Collection contributors = lastSelected.getMetadata().getContributors(); - Collection licenses = lastSelected.getMetadata().getLicense(); + String id = selectedEntry.getMetadata().getId(); + String descKey = "modmenu.descriptionTranslation." + id; + String translatedDesc = i18n.translateKey(descKey); + + String description; + if (!translatedDesc.equals(descKey)) { + description = translatedDesc; + } else { + description = selectedEntry.getMetadata().getDescription(); + } + + Collection authors = selectedEntry.getMetadata().getAuthors(); + Collection contributors = selectedEntry.getMetadata().getContributors(); + Collection licenses = selectedEntry.getMetadata().getLicense(); if (description.isEmpty() && HardcodedUtil.getHardcodedDescriptions().containsKey(id)) { description = HardcodedUtil.getHardcodedDescription(id); } From a1267461e5a40439b80982ccf4422480accb25d2 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 15:58:52 +0300 Subject: [PATCH 06/13] Update ModListEntry.java --- .../prospector/modmenu/gui/ModListEntry.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java b/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java index ccc28f42..749d0418 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListEntry.java @@ -14,6 +14,7 @@ import net.minecraft.client.render.renderer.Shaders; import net.minecraft.client.render.renderer.State; import net.minecraft.client.render.tessellator.TessellatorGeneral; +import net.minecraft.core.lang.I18n; import org.lwjgl.opengl.GL11; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,9 +53,15 @@ public void render(int index, int y, int x, int rowWidth, int rowHeight, int mou GLRenderer.setColor4f(1, 1, 1, 1); // We LOVE random color calls this.bindIconTexture(); internalRender(y, x); - String name = metadata.getName(); - if (name.equals("Minecraft")){ // BAD CODE - name = "Better than Adventure"; + String id = metadata.getId(); + String translationKey = "modmenu.nameTranslation." + id; + String translatedName = I18n.getInstance().translateKey(translationKey); + String name; + if (!translatedName.equals(translationKey)) { + name = translatedName; + } else { + name = metadata.getName(); + name = HardcodedUtil.formatFabricModuleName(name); } name = HardcodedUtil.formatFabricModuleName(name); String trimmedName = name; @@ -63,9 +70,13 @@ public void render(int index, int y, int x, int rowWidth, int rowHeight, int mou trimmedName = ModListScreen.getString(fontRenderer, name, trimmedName, maxNameWidth); this.drawStringNoShadow(font, trimmedName, x + 32 + 3, y + 1, 0xFFFFFF); new BadgeRenderer(client, x + 32 + 3 + font.stringWidth(name) + 2, y, x + rowWidth, container, list.getParent()).draw(mouseX, mouseY); - String description = metadata.getDescription(); - if (description.isEmpty() && HardcodedUtil.getHardcodedDescriptions().containsKey(metadata.getId())) { - description = HardcodedUtil.getHardcodedDescription(metadata.getId()); + String descKey = "modmenu.descriptionTranslation." + id; + String translatedDesc = I18n.getInstance().translateKey(descKey); + String description; + if (!translatedDesc.equals(descKey)) { + description = translatedDesc; + } else { + description = metadata.getDescription(); } RenderUtils.INSTANCE.drawWrappedString(this, description, (x + 32 + 3 + 4), (y + 9 + 2), rowWidth - 32 - 7, 2, 0x808080); From c5010eafd543bedff975b087177d06084c41f30f Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 16:00:00 +0300 Subject: [PATCH 07/13] Update ModListScreen.java --- .../prospector/modmenu/gui/ModListScreen.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index 07366dc3..949ac1d0 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -279,7 +279,7 @@ public void mouseReleased(int mouseX, int mouseY, int mouseButton) { @Override public void render(int mouseX, int mouseY, float delta) { I18n i18n = I18n.getInstance(); - + int dWheel = Mouse.getDWheel(); if (dWheel != 0) { double scrollDelta = dWheel > 0 ? 1.0 : -1.0; @@ -332,11 +332,18 @@ public void render(int mouseX, int mouseY, float delta) { ModListEntry.internalRender(paneY, x); int lineSpacing = 9 + 1; int imageOffset = 36; - String name = metadata.getName(); - if (name.equals("Minecraft")){ // BAD CODE - name = "Better than Adventure"; + String id = metadata.getId(); + String translationKey = "modmenu.nameTranslation." + id; + String translatedName = i18n.translateKey(translationKey); + String name; + if (!translatedName.equals(translationKey)) { + name = translatedName; + } else { + name = metadata.getName(); + name = HardcodedUtil.formatFabricModuleName(name); } name = HardcodedUtil.formatFabricModuleName(name); + String trimmedName = name; int maxNameWidth = this.width - (x + imageOffset); trimmedName = getString(font, name, trimmedName, maxNameWidth); From f10187bda527bcafbc78bd001a319a6fed00a9d8 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 16:05:26 +0300 Subject: [PATCH 08/13] Update en_US.lang --- src/main/resources/assets/modmenu/lang/en_US/en_US.lang | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/resources/assets/modmenu/lang/en_US/en_US.lang b/src/main/resources/assets/modmenu/lang/en_US/en_US.lang index 899411a9..c58b624c 100644 --- a/src/main/resources/assets/modmenu/lang/en_US/en_US.lang +++ b/src/main/resources/assets/modmenu/lang/en_US/en_US.lang @@ -26,3 +26,12 @@ modmenu.sorting.ascending=A-Z modmenu.sorting.decending=Z-A modmenu.minecraft=Minecraft modmenu.forge=Forge + +modmenu.nameTranslation.minecraft=Better than Adventure! +modmenu.descriptionTranslation.minecraft=The base game. +modmenu.nameTranslation.fabricloader=Fabric Loader +modmenu.descriptionTranslation.fabricloader=The base mod loader. +modmenu.nameTranslation.modmenu=Mod Menu +modmenu.descriptionTranslation.modmenu=Adds a mod menu to view the list of mods you have installed. +modmenu.nameTranslation.java=Java +modmenu.descriptionTranslation.java=The Java runtime environment. From 6cfd00cb08aeb9c2f43c3f969ad9d53df40a93cd Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Sun, 27 Sep 2026 23:50:25 +0300 Subject: [PATCH 09/13] Update ModListScreen.java --- .../io/github/prospector/modmenu/gui/ModListScreen.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index 949ac1d0..cd576d17 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -17,6 +17,7 @@ import net.minecraft.client.render.renderer.Shaders; import net.minecraft.client.render.renderer.State; import net.minecraft.client.render.tessellator.TessellatorGeneral; +import net.minecraft.client.util.helper.UrlHelper; import net.minecraft.core.Global; import net.minecraft.core.lang.I18n; import org.lwjgl.Sys; @@ -207,13 +208,11 @@ protected void buttonClicked(ButtonElement button) { break; } case WEBSITE_BUTTON_ID: { - final ModMetadata metadata = Objects.requireNonNull(selected).getMetadata(); - metadata.getContact().get("homepage").ifPresent(Sys::openURL); + Objects.requireNonNull(selected).getMetadata().getContact().get("homepage").ifPresent(UrlHelper::openURL); break; } case ISSUES_BUTTON_ID: { - final ModMetadata metadata = Objects.requireNonNull(selected).getMetadata(); - metadata.getContact().get("issues").ifPresent(Sys::openURL); + Objects.requireNonNull(selected).getMetadata().getContact().get("issues").ifPresent(UrlHelper::openURL); break; } case TOGGLE_FILTER_OPTIONS_BUTTON_ID: { From bb6fde283d8618c6a4ea7590f11bb02f80d26317 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Mon, 28 Sep 2026 10:33:36 +0300 Subject: [PATCH 10/13] Update HardcodedUtil.java --- .../java/io/github/prospector/modmenu/util/HardcodedUtil.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java index ca10db64..d9a753f4 100644 --- a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java +++ b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java @@ -15,10 +15,6 @@ public final class HardcodedUtil { private static final Set FABRIC_MODS = new HashSet<>(); private static final HashMap HARDCODED_DESCRIPTIONS = new HashMap<>(); - public static void initializeHardcodings() { - HARDCODED_DESCRIPTIONS.put("minecraft", new Random().nextInt(1000) == 0 ? "The based game." : "The base game."); - } - public static void hardcodeModuleMetadata(ModContainer mod, ModMetadata metadata, String id) { Matcher matcher = FABRIC_PATTERN.matcher(id); if (matcher.matches() || id.equals("fabric-api-base") || id.equals("fabric-renderer-indigo")) { From 2648d1ad85ae3e9bea5508dc788c7d77834fb580 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:30:23 +0300 Subject: [PATCH 11/13] Update ModListScreen.java --- .../io/github/prospector/modmenu/gui/ModListScreen.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java index cd576d17..13b04e3d 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java +++ b/src/main/java/io/github/prospector/modmenu/gui/ModListScreen.java @@ -355,12 +355,9 @@ public void render(int mouseX, int mouseY, float delta) { init = false; } badgeRenderer.draw(mouseX, mouseY); - String versionString; - if (metadata.getName().equals("Minecraft")){ // BAD CODE - versionString = Global.VERSION; - } else { - versionString = metadata.getVersion().getFriendlyString(); - } + String versionString = metadata.getId().equals("minecraft") + ? Global.VERSION + : metadata.getVersion().getFriendlyString(); this.drawStringNoShadow(font, "v" + versionString, x + imageOffset, paneY + 2 + lineSpacing, 0x808080); String authors; List names = new ArrayList<>(); From df9918ac1883d7efe88070487ca74eecf07a0b4f Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:14:16 +0300 Subject: [PATCH 12/13] Update DescriptionListWidget.java --- .../github/prospector/modmenu/gui/DescriptionListWidget.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java index 97ee2717..2a16d0aa 100644 --- a/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java +++ b/src/main/java/io/github/prospector/modmenu/gui/DescriptionListWidget.java @@ -58,9 +58,6 @@ public void render(int mouseX, int mouseY, float delta) { Collection authors = selectedEntry.getMetadata().getAuthors(); Collection contributors = selectedEntry.getMetadata().getContributors(); Collection licenses = selectedEntry.getMetadata().getLicense(); - if (description.isEmpty() && HardcodedUtil.getHardcodedDescriptions().containsKey(id)) { - description = HardcodedUtil.getHardcodedDescription(id); - } if (lastSelected != null && description != null && !description.isEmpty()) { for (String line : RenderUtils.INSTANCE.wrapStringToWidthAsList(textRenderer, description.replaceAll("\n", "\n\n"), getRowWidth())) { children().add(new DescriptionEntry(line)); From 6ace480a828291b2d650836e3ac4502bdb499396 Mon Sep 17 00:00:00 2001 From: Starman <135715391+StarmanMine142@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:14:57 +0300 Subject: [PATCH 13/13] Update HardcodedUtil.java --- .../io/github/prospector/modmenu/util/HardcodedUtil.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java index d9a753f4..983adf5e 100644 --- a/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java +++ b/src/main/java/io/github/prospector/modmenu/util/HardcodedUtil.java @@ -13,7 +13,6 @@ public final class HardcodedUtil { private static final Pattern FABRIC_PATTERN = Pattern.compile("^fabric-.*(-v\\d+)$"); private static final Set FABRIC_MODS = new HashSet<>(); - private static final HashMap HARDCODED_DESCRIPTIONS = new HashMap<>(); public static void hardcodeModuleMetadata(ModContainer mod, ModMetadata metadata, String id) { Matcher matcher = FABRIC_PATTERN.matcher(id); @@ -65,15 +64,7 @@ private static String capitalize(String str) { return sb.toString(); } - public static String getHardcodedDescription(String id) { - return HARDCODED_DESCRIPTIONS.getOrDefault(id, ""); - } - public static Set getFabricMods() { return FABRIC_MODS; } - - public static HashMap getHardcodedDescriptions() { - return HARDCODED_DESCRIPTIONS; - } }