添加对 25w45a_unobfuscated 的支持 (#4767)
This commit is contained in:
@@ -128,6 +128,7 @@ public class RemoteVersion implements Comparable<RemoteVersion> {
|
||||
RELEASE,
|
||||
SNAPSHOT,
|
||||
OLD,
|
||||
PENDING
|
||||
PENDING,
|
||||
UNOBFUSCATED,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ public final class GameRemoteVersion extends RemoteVersion {
|
||||
case SNAPSHOT -> Type.SNAPSHOT;
|
||||
case UNKNOWN -> Type.UNCATEGORIZED;
|
||||
case PENDING -> Type.PENDING;
|
||||
case UNOBFUSCATED -> Type.UNOBFUSCATED;
|
||||
default -> Type.OLD;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ public enum ReleaseType {
|
||||
OLD_BETA("old-beta"),
|
||||
OLD_ALPHA("old-alpha"),
|
||||
PENDING("pending"),
|
||||
UNOBFUSCATED("unobfuscated"),
|
||||
UNKNOWN("unknown");
|
||||
|
||||
private final String id;
|
||||
|
||||
@@ -100,7 +100,7 @@ public abstract sealed class GameVersionNumber implements Comparable<GameVersion
|
||||
}
|
||||
|
||||
public boolean isAprilFools() {
|
||||
if (this instanceof Special)
|
||||
if (this instanceof Special && !value.endsWith("_unobfuscated"))
|
||||
return true;
|
||||
|
||||
if (this instanceof Snapshot snapshot) {
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"id": "25w45a_unobfuscated",
|
||||
"type" : "unobfuscated",
|
||||
"url": "https://piston-meta.mojang.com/v1/packages/7a3c149f148b6aa5ac3af48c4f701adea7e5b615/25w45a_unobfuscated.json",
|
||||
"time" : "2025-11-04T14:07:08+00:00",
|
||||
"releaseTime" : "2025-11-04T14:07:08+00:00"
|
||||
},
|
||||
{
|
||||
"id": "1.19_deep_dark_experimental_snapshot-1",
|
||||
"type": "pending",
|
||||
|
||||
@@ -848,4 +848,10 @@
|
||||
1.21.9-rc1
|
||||
1.21.9
|
||||
1.21.10-rc1
|
||||
1.21.10
|
||||
1.21.10
|
||||
25w41a
|
||||
25w42a
|
||||
25w43a
|
||||
25w44a
|
||||
25w45a
|
||||
25w45a_unobfuscated
|
||||
@@ -121,6 +121,7 @@ public final class GameVersionNumberTest {
|
||||
assertFalse(isAprilFools("25w21a"));
|
||||
assertFalse(isAprilFools("13w12~"));
|
||||
assertFalse(isAprilFools("15w14b"));
|
||||
assertFalse(isAprilFools("25w45a_unobfuscated"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -272,6 +273,8 @@ public final class GameVersionNumberTest {
|
||||
"24w13a",
|
||||
"24w14potato",
|
||||
"24w14a",
|
||||
"25w45a",
|
||||
"25w45a_unobfuscated",
|
||||
"Unknown",
|
||||
"100.0"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user