Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions HMCL/src/main/java/org/jackhuang/hmcl/EntryPoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public static void main(String[] args) {
initIcon();
}

if (!Boolean.getBoolean("hmcl.bypass.osheck")) {
checkOperatingSystem();
}

checkJavaFX();
verifyJavaFX();
addEnableNativeAccess();
Expand Down Expand Up @@ -223,6 +227,22 @@ private static void verifyJavaFX() {
}
}

private static void checkOperatingSystem() {
String osName = System.getProperty("os.name", "").toLowerCase(java.util.Locale.ROOT);

String errorMessage = null;
if (osName.contains("haiku")) {
errorMessage = i18n("fatal.unsupported_platform.haiku");
}

if (errorMessage != null) {
SwingUtils.initLookAndFeel();
LOG.error("Unsupported OS: " + System.getProperty("os.name", ""));
SwingUtils.showErrorDialog(errorMessage, i18n("message.error"));
exit(1);
}
}

private static void addEnableNativeAccess() {
if (JavaRuntime.CURRENT_VERSION > 21) {
try {
Expand Down
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 @@ -459,6 +459,7 @@ fatal.unsupported_platform.windows_arm64=Hello Minecraft! Launcher has provided
\n\
If you are using the <b>Qualcomm</b> platform, you may need to install the <a href="ms-windows-store://pdp/?productid=9NQPSL29BFFF">OpenGL Compatibility Pack</a> before playing games.\n\
Click the link to navigate to the Microsoft Store and install the compatibility pack.
fatal.unsupported_platform.haiku=HMCL doesn't support Haiku due to some technical issues.\nIf you still want to play Minecraft on Haiku, consider other launchers.

file=File

Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ fatal.unsupported_platform=Minecraft 尚未對您的平臺提供完善支援,
fatal.unsupported_platform.loongarch=Hello Minecraft! Launcher 已為龍芯提供支援。\n如果遇到問題,你可以點擊右上角幫助按鈕進行求助。
fatal.unsupported_platform.macos_arm64=Hello Minecraft! Launcher 已為 Apple Silicon 平臺提供支援。使用 ARM 原生 Java 啟動遊戲以獲得更流暢的遊戲體驗。\n如果你在遊戲中遭遇問題,使用 x86-64 架構的 Java 啟動遊戲可能有更好的相容性。
fatal.unsupported_platform.windows_arm64=Hello Minecraft! Launcher 已為 Windows on Arm 平臺提供原生支援。如果你在遊戲中遭遇問題,請嘗試使用 x86 架構的 Java 啟動遊戲。\n\n如果你正在使用<b>高通</b>平臺,你可能需要安裝 <a href="ms-windows-store://pdp/?productid=9NQPSL29BFFF">OpenGL 相容包</a>後才能進行遊戲。點擊連結前往 Microsoft Store 安裝相容包。
fatal.unsupported_platform.haiku=HMCL doesn't support Haiku due to some technical issues.\nIf you still want to play Minecraft on Haiku, consider other launchers.\n\nHMCL 因技術問題並不支援 Haiku。\n若您仍希望在 Haiku 上遊玩 Minecraft,請考慮使用其他啟動器。

file=檔案

Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ fatal.unsupported_platform=Minecraft 尚未对你的平台提供完善支持,
fatal.unsupported_platform.loongarch=Hello Minecraft! Launcher 已为龙芯提供支持。\n如果遇到问题,你可以点击右上角帮助按钮进行求助。
fatal.unsupported_platform.macos_arm64=Hello Minecraft! Launcher 已为 Apple Silicon 平台提供支持。使用 ARM 原生 Java 启动游戏以获得更流畅的游戏体验。\n如果你在游戏中遇到问题,使用 x86-64 架构的 Java 启动游戏可能有更好的兼容性。\n如遇到问题,你可以点击右上角帮助按钮进行求助。
fatal.unsupported_platform.windows_arm64=Hello Minecraft! Launcher 已为 Windows on Arm 平台提供原生支持。如果你在游戏中遇到问题,请尝试使用 x86 架构的 Java 启动游戏。\n如果你正在使用 <b>高通</b> 平台,你可能需要安装 <a href="ms-windows-store://pdp/?productid=9NQPSL29BFFF">OpenGL 兼容包</a> 后才能进行游戏。点击链接前往 Microsoft Store 安装兼容包。\n如遇到问题,你可以点击右上角帮助按钮进行求助。
fatal.unsupported_platform.haiku=HMCL doesn't support Haiku due to some technical issues.\nIf you still want to play Minecraft on Haiku, consider other launchers.\n\nHMCL 因技术问题尚不支持 Haiku。\n若您仍希望在 Haiku 上游玩 Minecraft,请考虑使用其他启动器。

file=文件

Expand Down