forked from QuiltMC/quilt-standard-libraries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVersions.java
83 lines (69 loc) · 2.39 KB
/
Versions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package qsl.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
/**
* Version constants used across the convention build scripts.
* <p>
* To use inside of convention build scripts, simply import this class and refer to the public static final fields.
*/
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
public final class Versions {
/*
* These must be in a Java class file due to issues with keeping this data in the groovy source set, since the
* convention plugins will not be able to see the groovy classes then.
*
* The gradle.properties does not work here either because you would need to load it in every single project, and it
* is not strictly defined in the IDE.
*/
/**
* The QSL version
*/
public static final String QSL_VERSION = "3.0.0-beta.24";
/**
* The target Minecraft version.
*/
public static final MinecraftVersion MINECRAFT_VERSION = new MinecraftVersion("1.19.2");
/**
* The Minecraft versions this version of QSL is compatible with.
*/
public static final List<MinecraftVersion> COMPATIBLE_VERSIONS = versions(new MinecraftVersion("1.19.1"));
/**
* The target Quilt Mappings build.
*/
public static final int MAPPINGS_BUILD = 21;
/**
* The version of Quilt Loader to use.
*/
public static final String LOADER_VERSION = "0.17.6";
/**
* The target Java version.
*/
public static final int JAVA_VERSION = 17; // Minecraft is Java 17
//region 3rd-parties libraries/mods to test
/**
* The version of Databreaker to use in the no-op DFU testmod.
*/
public static Optional<String> DATABREAKER_VERSION = Optional.empty(); //of("0.2.10");
/**
* The version of LazyDFU to use in the DFU testmods.
*/
public static Optional<String> LAZYDFU_VERSION = Optional.empty(); //of("0.1.3");
//endregion
private Versions() {
}
private static List<MinecraftVersion> versions(Object... versions) {
var list = new ArrayList<MinecraftVersion>();
for (var version : versions) {
if (version instanceof String name) {
list.add(new MinecraftVersion(name, MINECRAFT_VERSION.versionEdition()));
} else if (version instanceof MinecraftVersion mcVersion) {
list.add(mcVersion);
} else {
throw new IllegalArgumentException("Unexpected version \"" + version + "\", only String and MinecraftVersion are accepted.");
}
}
return Collections.unmodifiableList(list);
}
}