-
Notifications
You must be signed in to change notification settings - Fork 731
feat #3763: add April Fool's Day version category #3905
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
base: main
Are you sure you want to change the base?
Conversation
缺失了 2.0 愚人节版本,因为 client json 所标注的时间是错误的(这些 client json 来自 Minecraft Wiki),或许应该单独做判断? 而且版本 id 后缀包含类型,然后跳转到了错误的地址( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firstly, I'm concerned about the UI overflow that might result from too many options above. Check the image.
Secondly, the time displayed on this page changes depending on the user's current time zone, which in some different time zones may result in this category not presenting results at all. I think you should use other methods to achieve the same effect and make sure that the results are displayed as they should be even in various time zones.
add special judgement for 'Minecraft 2.0' when classifying minecraft versions
Adding a separate panel for the search box would solve it. Is that acceptable?
Most April Fools' versions were released on 1 April UTC. However, there exists an April Fools' Day version released on 31 March UTC, which is Java_Edition_1.RV-Pre1 Maybe use UTC time for judgement and special judgement for Java_Edition_1.RV-Pre1? |
我觉得可以直接硬编这些已有的愚人节版本,然后再判断 4 月 1 日的版本(将这个判断视作硬编前的特殊判断) |
Hardcoding would result in the need to modify the source code for each release of April Fool's Day version. |
Personally, I think that for the search and refresh icons, you can just keep the icons themselves.
I feel good. |
Indeed, it looks better the way you said. I have implemented it in the latest commit. (e4b98f5). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1351,6 +1351,7 @@ version.empty=No Instances | |||
version.empty.add=Add new instance | |||
version.empty.launch=No available instances. Clicking "OK" will take you to the "Download" page.\n\nYou can also download the game or switch game directories via the "Download" or "All Instances" buttons on the HMCL homepage. | |||
version.empty.hint=There are no Minecraft instances here.\nYou can try switching to another game directory or clicking here to download one. | |||
version.game.aprilfools=AprilFools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version.game.aprilfools=AprilFools | |
version.game.aprilfools=April Fools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add support for an April Fool’s Day version category across backend classification, UI filters, and localization.
- Introduces a new
ReleaseType.APRILFOOLS
and maps specific version patterns or release dates toType.APRILFOOLS
- Updates the version list UI to include an April Fool’s filter checkbox and display tag
- Adds localization entries for Chinese (simplified & traditional) and English
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
HMCLCore/src/main/java/org/jackhuang/hmcl/game/ReleaseType.java | Add new APRILFOOLS enum constant |
HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java | Enhance getReleaseType() to detect April Fool’s versions |
HMCLCore/src/main/java/org/jackhuang/hmcl/download/RemoteVersion.java | Extend Type enum with APRILFOOLS |
HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties | Add version.game.aprilfools translation |
HMCL/src/main/resources/assets/lang/I18N_zh.properties | Add version.game.aprilfools translation |
HMCL/src/main/resources/assets/lang/I18N.properties | Add version.game.aprilfools translation (English) |
HMCL/src/main/java/org/jackhuang/hmcl/ui/download/VersionsPage.java | Add April Fool’s filter checkbox and display logic in the UI |
Comments suppressed due to low confidence (1)
HMCLCore/src/main/java/org/jackhuang/hmcl/download/game/GameRemoteVersion.java:65
- The new APRILFOOLS detection logic isn’t covered by existing tests; consider adding unit tests for versions on April 1st and matching version-prefix scenarios.
private static Type getReleaseType(ReleaseType type, Instant releaseDate, String gameVersion) {
if (type == null) return Type.UNCATEGORIZED; | ||
private static Type getReleaseType(ReleaseType type, Instant releaseDate, String gameVersion) { | ||
if (type == null || releaseDate == null || gameVersion == null) return Type.UNCATEGORIZED; | ||
if (gameVersion.startsWith("2.0")) return Type.APRILFOOLS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded prefix "2.0" is a magic string; consider extracting it into a descriptive constant (e.g., APRIL_FOOLS_VERSION_PREFIX) to improve readability.
if (gameVersion.startsWith("2.0")) return Type.APRILFOOLS; | |
if (gameVersion.startsWith(APRIL_FOOLS_VERSION_PREFIX)) return Type.APRILFOOLS; |
Copilot uses AI. Check for mistakes.
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); | ||
cal.setTime(Date.from(releaseDate)); | ||
int month = cal.get(Calendar.MONTH); | ||
int day = cal.get(Calendar.DAY_OF_MONTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses the legacy Calendar/Date API; consider using java.time (e.g., releaseDate.atZone(ZoneOffset.UTC)
) for clearer and more modern date handling.
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); | |
cal.setTime(Date.from(releaseDate)); | |
int month = cal.get(Calendar.MONTH); | |
int day = cal.get(Calendar.DAY_OF_MONTH); | |
int month = releaseDate.atZone(ZoneOffset.UTC).getMonthValue() - 1; // Adjust to match Calendar.MONTH | |
int day = releaseDate.atZone(ZoneOffset.UTC).getDayOfMonth(); |
Copilot uses AI. Check for mistakes.
@@ -1351,6 +1351,7 @@ version.empty=No Instances | |||
version.empty.add=Add new instance | |||
version.empty.launch=No available instances. Clicking "OK" will take you to the "Download" page.\n\nYou can also download the game or switch game directories via the "Download" or "All Instances" buttons on the HMCL homepage. | |||
version.empty.hint=There are no Minecraft instances here.\nYou can try switching to another game directory or clicking here to download one. | |||
version.game.aprilfools=AprilFools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The English label "AprilFools" lacks spacing; consider changing it to "April Fools" or "April Fool's" for better readability.
version.game.aprilfools=AprilFools | |
version.game.aprilfools=April Fools |
Copilot uses AI. Check for mistakes.
content.getTags().setAll(i18n("version.game.aprilfools")); | ||
content.setImage(VersionIconType.COMMAND.getIcon()); | ||
if (remoteVersion.getGameVersion().startsWith("2.0")) { | ||
content.setExternalLink(i18n("wiki.version.game.snapshot", "2.0")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The APRILFOOLS case reuses the snapshot wiki link; consider defining a dedicated translation key or URL (e.g., wiki.version.game.aprilfools
) to avoid confusion for end users.
Copilot uses AI. Check for mistakes.
这样修改应该会破坏 Version 的序列化,我有空再看看。 |
feat #3763

add April Fool's Day version category