Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Neoforge #2625

Closed
wants to merge 115 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
c497f71
Support #2376
burningtnt Jul 22, 2023
8c453be
Add necessary @Nullable annotations
burningtnt Jul 22, 2023
face066
Display different types of dependencies in different sections.
burningtnt Jul 28, 2023
8928f29
Fix checkstyle
burningtnt Jul 28, 2023
1ba62a6
Add I18N for different types of dependencies.
burningtnt Jul 28, 2023
73510ba
Enhance UI
burningtnt Jul 28, 2023
4b8a5f0
Code cleanup
burningtnt Jul 28, 2023
0e460c9
Enhance UI
burningtnt Jul 29, 2023
87ea846
Manually sort the result from curseforge when searching mods by name.
burningtnt Jul 29, 2023
ed355d8
Render the search results from remote mod repositories in several pages.
burningtnt Jul 29, 2023
0c292eb
Merge branch 'support1549/better-mod-search' into support2376/enhance…
burningtnt Jul 29, 2023
978742a
Fix merge
burningtnt Jul 29, 2023
ae49422
Fix
burningtnt Jul 29, 2023
4779597
Add a button which navigates to the modpack download page in the modp…
burningtnt Jul 29, 2023
6d72873
Fix I18N
burningtnt Jul 29, 2023
e860146
Render the mod loaders supported by the version in mod info page.
burningtnt Jul 29, 2023
ab64be9
Fix #2104
burningtnt Jul 30, 2023
adfa728
Enhance TwoLineListItem
burningtnt Aug 1, 2023
1810f85
Merge branch 'enhance/TwoLineListItem' into support2376/enhance-mod-d…
burningtnt Aug 1, 2023
20b0691
Render the mod loader supported by this mod file on the ModListPage
burningtnt Aug 1, 2023
61a91fa
Fix chinese searching and curseforge searching
burningtnt Aug 2, 2023
b0322f0
Update I18N
burningtnt Aug 2, 2023
ff4c0b6
Fix
burningtnt Aug 2, 2023
8efaf9d
Fix
burningtnt Aug 2, 2023
f681f71
Select the specific game version when clicking the 'download' button …
burningtnt Aug 2, 2023
7c62bf4
Support HMCL to update mod_data and mod_pack data from https://github…
burningtnt Aug 7, 2023
caf9cb2
Enhance :HMCL:build.gradle.kts
burningtnt Aug 8, 2023
9ae490d
Merge branch 'official' into support2376/enhance-mod-download
burningtnt Aug 8, 2023
e27c5dc
Revert parse_mcmod_data.py
burningtnt Aug 8, 2023
545c4f2
Abstract 'new Image' to FXUtils.newBuiltinImage and FXUtils.newRemote…
burningtnt Aug 8, 2023
ec50706
Add javadoc for FXUtils.newBuiltinImage and FXUtils.newRemoteImage.
burningtnt Aug 8, 2023
ffa81cd
Fix checkstyle
burningtnt Aug 8, 2023
430bfdf
Fix
burningtnt Aug 9, 2023
bbabfc3
Fix
burningtnt Aug 9, 2023
771dbea
Fix
burningtnt Aug 9, 2023
886fd03
Add license for RemoteResourceManager
burningtnt Aug 9, 2023
931c4b0
Remove TODO
burningtnt Aug 9, 2023
dfe96e4
Enhance Chinese searching
burningtnt Aug 9, 2023
3effb37
Support to decode metadata for local quilt mod.
burningtnt Aug 10, 2023
1b94a90
Enhance ModManager
burningtnt Aug 10, 2023
d599612
Fix checkstyle
burningtnt Aug 10, 2023
82a6a0c
Refactor
burningtnt Aug 10, 2023
7e45fe8
Fix
burningtnt Aug 11, 2023
5543cd1
Fix
burningtnt Aug 11, 2023
953558d
Refactor DownloadPage
burningtnt Aug 11, 2023
17c076b
Fix
burningtnt Aug 11, 2023
45dd87f
Revert "Refactor DownloadPage"
burningtnt Aug 12, 2023
8345dd5
Refactor DownloadPage
burningtnt Aug 12, 2023
f3b21d6
Refactor
burningtnt Aug 12, 2023
a86bfcf
Fix
burningtnt Aug 12, 2023
c9dcc7c
Fix checkstyle
burningtnt Aug 12, 2023
b1a008c
Set org.jackhuang.hmcl.ui.construct.TwoLineListItem.TagChangeListener…
burningtnt Aug 12, 2023
25cf498
Fix
burningtnt Aug 12, 2023
c1c7404
Fix
burningtnt Aug 13, 2023
0a83210
Fix
burningtnt Aug 13, 2023
d735cd9
Enhance SimpleMultimap
burningtnt Aug 24, 2023
8e9bf57
Revert TwoLineListItem
burningtnt Aug 26, 2023
3a4a64a
Fix
burningtnt Aug 26, 2023
e9331e4
Merge branch 'official' into support2376/enhance-mod-download
burningtnt Aug 26, 2023
6776856
Code cleanup
burningtnt Aug 27, 2023
0fb4ea2
Code cleanup
burningtnt Aug 27, 2023
adee9a6
Fix
burningtnt Aug 27, 2023
9db9e9f
Code cleanup
burningtnt Aug 28, 2023
a043057
Add license for IModMetadataReader
burningtnt Aug 28, 2023
021d062
Add prefix 'Minecraft' at the supported minecrft version list in Down…
burningtnt Aug 29, 2023
e9aed55
Fix #2498
burningtnt Sep 10, 2023
7566b6a
Update README_cn.md
burningtnt Sep 17, 2023
61d8add
Opti ModMananger
burningtnt Sep 18, 2023
a49d2f8
Log a warning message when 'hmcl.update_source.override' is used.
burningtnt Sep 26, 2023
13600e5
Fix chinese searching
burningtnt Oct 2, 2023
0f395f3
Merge branch 'official' into support2376/enhance-mod-download
burningtnt Oct 2, 2023
f52d64d
Enhance chinese searching.
burningtnt Oct 2, 2023
41e8d75
Enhance memory usage
burningtnt Oct 2, 2023
5a5aa09
Add basic support for NeoForge.
burningtnt Oct 4, 2023
c259a9a
Enable HMCl to show the version list of NeoForged.
burningtnt Oct 4, 2023
29ccb4c
Fix checkstyle
burningtnt Oct 4, 2023
f8a01a7
Enable HMCL to download and install NeoForged from BMCL. Fix some bugs.
burningtnt Oct 4, 2023
2a99e1d
Close the mod version dialog window after clicking the downloading / …
burningtnt Oct 4, 2023
d444a15
Merge branch 'support2376/enhance-mod-download' into neoforge
burningtnt Oct 4, 2023
b08bdb3
Fix
burningtnt Oct 4, 2023
f6f855b
Enable HMCL to install NeoForge from modpacks.
burningtnt Oct 4, 2023
712fb1b
Fix the dirty implememtation
burningtnt Oct 5, 2023
1843602
Fix UI
burningtnt Oct 5, 2023
8eb7ef6
Cache builtin images.
burningtnt Oct 25, 2023
0a49eb2
Enhance FXUtils (Make tooltip installer faster).
burningtnt Oct 27, 2023
97db774
Fix
burningtnt Oct 28, 2023
dba600d
Fix
burningtnt Oct 28, 2023
e648a6d
Fix #2560
burningtnt Oct 29, 2023
2ea0196
Fix typo
burningtnt Oct 30, 2023
76fb8f7
Fix remote image cache.
burningtnt Oct 30, 2023
873af70
Fix javadoc
burningtnt Oct 31, 2023
961655c
Fix checkstyle
burningtnt Nov 5, 2023
798adab
Optimize FXUtils::shutdown
burningtnt Nov 5, 2023
3c303d7
Support NeoForged 1.20.2
burningtnt Nov 5, 2023
c822dc5
Merge branch 'javafx' into support2376/enhance-mod-download
Nov 11, 2023
e7782e8
Fix merge
Nov 11, 2023
b60cf41
I have no idea on why the sha1 was matched.
Nov 11, 2023
6fd0fc2
Merge branch 'javafx' into support2376/enhance-mod-download
Nov 14, 2023
a5fd8b7
Merge branch 'support2376/enhance-mod-download' into neoforge
burningtnt Nov 19, 2023
9bc0523
Revert "Enhance FXUtils (Make tooltip installer faster)."
burningtnt Nov 27, 2023
f951864
Support multi download source in order balance the traffic of hmcl.hu…
burningtnt Nov 29, 2023
375b2c4
Modify dynamic remote resource urls.
burningtnt Nov 29, 2023
ac8a50e
Merge branch 'support2376/enhance-mod-download' into neoforge
burningtnt Nov 30, 2023
a25b204
Merge branch 'javafx' into support2376/enhance-mod-download
burningtnt Dec 1, 2023
2db603d
Optimize codes with StringUtils.DynamicCommonSubsequence.
burningtnt Dec 10, 2023
6e21c02
Prevent unofficial HMCL to access HMCL Resource Update URL.
burningtnt Dec 10, 2023
284b84a
Zip the dynamic-remote-resources json by Gradle automatically.
burningtnt Dec 15, 2023
c0a2fd5
Remove unnecessary getters.
burningtnt Dec 15, 2023
ee1c063
Fix
burningtnt Dec 16, 2023
16f0119
Merge branch 'support2376/enhance-mod-download' into neoforge
burningtnt Dec 17, 2023
db26fec
Fix LibraryAnalyzer: Cannot analyze the version number of NeoForge co…
burningtnt Dec 18, 2023
263a3fa
Merge branch 'javafx' into neoforge
burningtnt Dec 18, 2023
11405b5
Support to choose the NeoForge icon if a game is installed with NeoFo…
burningtnt Dec 18, 2023
22de997
Merge branch 'javafx' into neoforge
burningtnt Jan 1, 2024
a82a8a3
Fix checkstyle
burningtnt Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ else if (LibraryAnalyzer.isModded(this, version)) {
return newBuiltinImage("/assets/img/fabric.png");
else if (libraryAnalyzer.has(LibraryAnalyzer.LibraryType.FORGE))
return newBuiltinImage("/assets/img/forge.png");
else if (libraryAnalyzer.has(LibraryAnalyzer.LibraryType.NEO_FORGED))
return newBuiltinImage("/assets/img/neoforge.png");
else if (libraryAnalyzer.has(LibraryAnalyzer.LibraryType.QUILT))
return newBuiltinImage("/assets/img/quilt.png");
else if (libraryAnalyzer.has(LibraryAnalyzer.LibraryType.OPTIFINE))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,7 @@ private static Task<JavaVersion> checkGameState(Profile profile, VersionSetting
break;
case MODDED_JAVA_16:
// Minecraft<=1.17.1+Forge[37.0.0,37.0.60) not compatible with Java 17
String forgePatchVersion = analyzer.getVersion(LibraryAnalyzer.LibraryType.FORGE)
.map(LibraryAnalyzer.LibraryType.FORGE::patchVersion)
.orElse(null);
String forgePatchVersion = analyzer.getVersion(LibraryAnalyzer.LibraryType.FORGE).orElse(null);
if (forgePatchVersion != null && VersionNumber.VERSION_COMPARATOR.compare(forgePatchVersion, "37.0.60") < 0)
suggestions.add(i18n("launch.advice.forge37_0_60"));
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public enum VersionIconType {
COMMAND("/assets/img/command.png"),
CRAFT_TABLE("/assets/img/craft_table.png"),
FABRIC("/assets/img/fabric.png"),
FORGE("/assets/img/forge.png"),
FORGE("/assets/img/forge.png"),
NEO_FORGED("/assets/img/neoforge.png"),
FURNACE("/assets/img/furnace.png"),
QUILT("/assets/img/quilt.png");

Expand Down
30 changes: 23 additions & 7 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public InstallerItem(String id) {
case "quilt-api":
imageUrl = "/assets/img/quilt.png";
break;
case "neoforge":
imageUrl = "/assets/img/neoforge.png";
break;
default:
imageUrl = null;
break;
Expand Down Expand Up @@ -122,6 +125,7 @@ public static class InstallerItemGroup {
public final InstallerItem fabric = new InstallerItem(FABRIC);
public final InstallerItem fabricApi = new InstallerItem(FABRIC_API);
public final InstallerItem forge = new InstallerItem(FORGE);
public final InstallerItem neoForged = new InstallerItem(NEO_FORGED);
public final InstallerItem liteLoader = new InstallerItem(LITELOADER);
public final InstallerItem optiFine = new InstallerItem(OPTIFINE);
public final InstallerItem quilt = new InstallerItem(QUILT);
Expand All @@ -131,30 +135,41 @@ public InstallerItemGroup() {
forge.incompatibleLibraryName.bind(Bindings.createStringBinding(() -> {
if (fabric.libraryVersion.get() != null) return FABRIC.getPatchId();
if (quilt.libraryVersion.get() != null) return QUILT.getPatchId();
if (neoForged.libraryVersion.get() != null) return NEO_FORGED.getPatchId();
return null;
}, fabric.libraryVersion, quilt.libraryVersion, neoForged.libraryVersion));

neoForged.incompatibleLibraryName.bind(Bindings.createStringBinding(() -> {
if (fabric.libraryVersion.get() != null) return FABRIC.getPatchId();
if (quilt.libraryVersion.get() != null) return QUILT.getPatchId();
if (forge.libraryVersion.get() != null) return FORGE.getPatchId();
return null;
}, fabric.libraryVersion, quilt.libraryVersion));
}, fabric.libraryVersion, quilt.libraryVersion, forge.libraryVersion));

liteLoader.incompatibleLibraryName.bind(Bindings.createStringBinding(() -> {
if (fabric.libraryVersion.get() != null) return FABRIC.getPatchId();
if (quilt.libraryVersion.get() != null) return QUILT.getPatchId();
if (neoForged.libraryVersion.get() != null) return NEO_FORGED.getPatchId();
return null;
}, fabric.libraryVersion, quilt.libraryVersion));
}, fabric.libraryVersion, quilt.libraryVersion, neoForged.libraryVersion));

optiFine.incompatibleLibraryName.bind(Bindings.createStringBinding(() -> {
if (fabric.libraryVersion.get() != null) return FABRIC.getPatchId();
if (quilt.libraryVersion.get() != null) return QUILT.getPatchId();
if (neoForged.libraryVersion.get() != null) return NEO_FORGED.getPatchId();
return null;
}, fabric.libraryVersion, quilt.libraryVersion));
}, fabric.libraryVersion, quilt.libraryVersion, neoForged.libraryVersion));

for (InstallerItem fabric : new InstallerItem[]{fabric, fabricApi}) {
fabric.incompatibleLibraryName.bind(Bindings.createStringBinding(() -> {
if (forge.libraryVersion.get() != null) return FORGE.getPatchId();
if (neoForged.libraryVersion.get() != null) return NEO_FORGED.getPatchId();
if (liteLoader.libraryVersion.get() != null) return LITELOADER.getPatchId();
if (optiFine.libraryVersion.get() != null) return OPTIFINE.getPatchId();
if (quilt.libraryVersion.get() != null) return QUILT.getPatchId();
if (quiltApi.libraryVersion.get() != null) return QUILT_API.getPatchId();
return null;
}, forge.libraryVersion, liteLoader.libraryVersion, optiFine.libraryVersion, quilt.libraryVersion, quiltApi.libraryVersion));
}, forge.libraryVersion, neoForged.libraryVersion, liteLoader.libraryVersion, optiFine.libraryVersion, quilt.libraryVersion, quiltApi.libraryVersion));
}

fabricApi.dependencyName.bind(Bindings.createStringBinding(() -> {
Expand All @@ -167,10 +182,11 @@ public InstallerItemGroup() {
if (fabric.libraryVersion.get() != null) return FABRIC.getPatchId();
if (fabricApi.libraryVersion.get() != null) return FABRIC_API.getPatchId();
if (forge.libraryVersion.get() != null) return FORGE.getPatchId();
if (neoForged.libraryVersion.get() != null) return NEO_FORGED.getPatchId();
if (liteLoader.libraryVersion.get() != null) return LITELOADER.getPatchId();
if (optiFine.libraryVersion.get() != null) return OPTIFINE.getPatchId();
return null;
}, fabric.libraryVersion, fabricApi.libraryVersion, forge.libraryVersion, liteLoader.libraryVersion, optiFine.libraryVersion));
}, fabric.libraryVersion, fabricApi.libraryVersion, forge.libraryVersion, neoForged.libraryVersion, liteLoader.libraryVersion, optiFine.libraryVersion));
}

quiltApi.dependencyName.bind(Bindings.createStringBinding(() -> {
Expand All @@ -180,7 +196,7 @@ public InstallerItemGroup() {
}

public InstallerItem[] getLibraries() {
return new InstallerItem[]{game, forge, liteLoader, optiFine, fabric, fabricApi, quilt, quiltApi};
return new InstallerItem[]{game, forge, neoForged, liteLoader, optiFine, fabric, fabricApi, quilt, quiltApi};
}
}

Expand All @@ -206,7 +222,7 @@ public static class InstallerItemSkin extends SkinBase<InstallerItem> {
pane.pseudoClassStateChanged(CARD, control.style == Style.CARD);

if (control.imageUrl != null) {
ImageView view = new ImageView(FXUtils.newRemoteImage(control.imageUrl));
ImageView view = new ImageView(FXUtils.newBuiltinImage(control.imageUrl));
Node node = FXUtils.limitingSize(view, 32, 32);
node.setMouseTransparent(true);
node.getStyleClass().add("installer-item-image");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.jackhuang.hmcl.download.game.GameInstallTask;
import org.jackhuang.hmcl.download.java.JavaDownloadTask;
import org.jackhuang.hmcl.download.liteloader.LiteLoaderInstallTask;
import org.jackhuang.hmcl.download.neoforge.NeoForgedInstallTask;
import org.jackhuang.hmcl.download.optifine.OptiFineInstallTask;
import org.jackhuang.hmcl.download.quilt.QuiltAPIInstallTask;
import org.jackhuang.hmcl.download.quilt.QuiltInstallTask;
Expand Down Expand Up @@ -123,6 +124,8 @@ public void onRunning(Task<?> task) {
task.setName(i18n("install.installer.install", i18n("install.installer.game")));
} else if (task instanceof ForgeNewInstallTask || task instanceof ForgeOldInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.forge")));
} else if (task instanceof NeoForgedInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.neoforge")));
} else if (task instanceof LiteLoaderInstallTask) {
task.setName(i18n("install.installer.install", i18n("install.installer.liteloader")));
} else if (task instanceof OptiFineInstallTask) {
Expand Down Expand Up @@ -248,6 +251,7 @@ public StageNode(String stage) {
case "hmcl.install.assets": message = i18n("assets.download"); break;
case "hmcl.install.game": message = i18n("install.installer.install", i18n("install.installer.game") + " " + stageValue); break;
case "hmcl.install.forge": message = i18n("install.installer.install", i18n("install.installer.forge") + " " + stageValue); break;
case "hmcl.install.neoforge": message = i18n("install.installer.install", i18n("install.installer.neoforge") + " " + stageValue); break;
case "hmcl.install.liteloader": message = i18n("install.installer.install", i18n("install.installer.liteloader") + " " + stageValue); break;
case "hmcl.install.optifine": message = i18n("install.installer.install", i18n("install.installer.optifine") + " " + stageValue); break;
case "hmcl.install.fabric": message = i18n("install.installer.install", i18n("install.installer.fabric") + " " + stageValue); break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Control;
import javafx.scene.control.Label;
import javafx.scene.control.Skin;
import javafx.scene.control.SkinBase;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import org.jackhuang.hmcl.download.DownloadProvider;
import org.jackhuang.hmcl.download.LibraryAnalyzer;
import org.jackhuang.hmcl.download.RemoteVersion;
import org.jackhuang.hmcl.game.HMCLGameRepository;
import org.jackhuang.hmcl.ui.Controllers;
Expand Down Expand Up @@ -72,9 +70,9 @@ public InstallersPage(WizardController controller, HMCLGameRepository repository

for (InstallerItem library : group.getLibraries()) {
String libraryId = library.getLibraryId();
if (libraryId.equals("game")) continue;
if (libraryId.equals(LibraryAnalyzer.LibraryType.MINECRAFT.getPatchId())) continue;
library.action.set(e -> {
if ("fabric-api".equals(libraryId)) {
if (LibraryAnalyzer.LibraryType.FABRIC_API.getPatchId().equals(libraryId)) {
Controllers.dialog(i18n("install.installer.fabric-api.warning"), i18n("message.warning"), MessageDialogPane.MessageType.WARNING);
}

Expand Down Expand Up @@ -155,10 +153,13 @@ protected InstallersPageSkin(InstallersPage control) {

{
FlowPane libraryPane = new FlowPane(control.group.getLibraries());
BorderPane.setMargin(libraryPane, new Insets(16, 0, 16, 0));
libraryPane.setVgap(16);
libraryPane.setHgap(16);
root.setCenter(libraryPane);
ScrollPane scrollPane = new ScrollPane(libraryPane);
scrollPane.setFitToWidth(true);
scrollPane.setFitToHeight(true);
BorderPane.setMargin(scrollPane, new Insets(16, 0, 16, 0));
root.setCenter(scrollPane);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.jackhuang.hmcl.download.forge.ForgeRemoteVersion;
import org.jackhuang.hmcl.download.game.GameRemoteVersion;
import org.jackhuang.hmcl.download.liteloader.LiteLoaderRemoteVersion;
import org.jackhuang.hmcl.download.neoforge.NeoForgedRemoteVersion;
import org.jackhuang.hmcl.download.optifine.OptiFineRemoteVersion;
import org.jackhuang.hmcl.download.quilt.QuiltAPIRemoteVersion;
import org.jackhuang.hmcl.download.quilt.QuiltRemoteVersion;
Expand Down Expand Up @@ -335,6 +336,8 @@ else if (remoteVersion instanceof OptiFineRemoteVersion)
iconType = VersionIconType.COMMAND;
else if (remoteVersion instanceof ForgeRemoteVersion)
iconType = VersionIconType.FORGE;
else if (remoteVersion instanceof NeoForgedRemoteVersion)
iconType = VersionIconType.NEO_FORGED;
else if (remoteVersion instanceof FabricRemoteVersion || remoteVersion instanceof FabricAPIRemoteVersion)
iconType = VersionIconType.FABRIC;
else if (remoteVersion instanceof QuiltRemoteVersion || remoteVersion instanceof QuiltAPIRemoteVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ private static final class ModItem extends StackPane {
case FORGE:
content.getTags().add(i18n("install.installer.forge"));
break;
case NEO_FORGED:
content.getTags().add(i18n("install.installer.neoforge"));
break;
case FABRIC:
content.getTags().add(i18n("install.installer.fabric"));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void loadVersion(Profile profile, String versionId) {

InstallerItem.InstallerItemGroup group = new InstallerItem.InstallerItemGroup();

// Conventional libraries: game, fabric, forge, liteloader, optifine
// Conventional libraries: game, fabric, forge, neoforged, liteloader, optifine
for (InstallerItem installerItem : group.getLibraries()) {
String libraryId = installerItem.getLibraryId();
String libraryVersion = analyzer.getVersion(libraryId).orElse(null);
Expand All @@ -96,7 +96,7 @@ public void loadVersion(Profile profile, String versionId) {
installerItem.action.set(e -> {
Controllers.getDecorator().startWizard(new UpdateInstallerWizardProvider(profile, gameVersion, version, libraryId, libraryVersion));
});
boolean removable = !"game".equals(libraryId) && libraryVersion != null;
boolean removable = !LibraryAnalyzer.LibraryType.MINECRAFT.getPatchId().equals(libraryId) && libraryVersion != null;
installerItem.removable.set(removable);
if (removable) {
Runnable action = removeAction.apply(libraryId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,28 @@ class ModInfoDialog extends JFXDialogLayout {
RemoteMod remoteMod = remoteModRepository.getModById(versionOptional.get().getModid());
FXUtils.runInFX(() -> {
for (ModLoaderType modLoaderType : versionOptional.get().getLoaders()) {
String loaderName;
switch (modLoaderType) {
case FABRIC:
case FORGE:
loaderName = i18n("install.installer.forge");
break;
case NEO_FORGED:
loaderName = i18n("install.installer.neoforge");
break;
case FABRIC:
loaderName = i18n("install.installer.fabric");
break;
case LITE_LOADER:
case QUILT: {
if (!title.getTags().contains(modLoaderType.getLoaderName())) {
title.getTags().add(modLoaderType.getLoaderName());
}
}
loaderName = i18n("install.installer.liteloader");
break;
case QUILT:
loaderName = i18n("install.installer.quilt");
break;
default:
continue;
}
if (!title.getTags().contains(loaderName)) {
title.getTags().add(loaderName);
}
}

Expand Down Expand Up @@ -457,7 +470,23 @@ protected void updateControl(ModInfoObject dataItem, boolean empty) {
if (empty) return;
content.setTitle(dataItem.getTitle());
content.getTags().clear();
content.getTags().add(dataItem.getModInfo().getModLoaderType().getLoaderName());
switch (dataItem.getModInfo().getModLoaderType()) {
case FORGE:
content.getTags().add(i18n("install.installer.forge"));
break;
case NEO_FORGED:
content.getTags().add(i18n("install.installer.neoforge"));
break;
case FABRIC:
content.getTags().add(i18n("install.installer.fabric"));
break;
case LITE_LOADER:
content.getTags().add(i18n("install.installer.liteloader"));
break;
case QUILT:
content.getTags().add(i18n("install.installer.quilt"));
break;
}
if (dataItem.getMod() != null) {
if (I18n.getCurrentLocale().getLocale() == Locale.CHINA) {
content.getTags().add(dataItem.getMod().getDisplayName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public VersionIconDialog(Profile profile, String versionId, Runnable onFinish) {
createIcon(VersionIconType.CRAFT_TABLE),
createIcon(VersionIconType.FABRIC),
createIcon(VersionIconType.FORGE),
createIcon(VersionIconType.NEO_FORGED),
createIcon(VersionIconType.FURNACE),
createIcon(VersionIconType.QUILT)
);
Expand Down
Binary file added HMCL/src/main/resources/assets/img/neoforge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ install.installer.fabric=Fabric
install.installer.fabric-api=Fabric API
install.installer.fabric-api.warning=Warning: Fabric API is a mod, and will be installed into the mod directory of the game instance. Please do not change the working directory of the game, or the Fabric API will not work. If you do want to change these settings, you should reinstall it.
install.installer.forge=Forge
install.installer.neoforge=NeoForge
install.installer.game=Minecraft
install.installer.incompatible=Incompatible with %s
install.installer.install=Install %s
Expand Down
Loading