Some docs
This commit is contained in:
@@ -51,6 +51,9 @@ public record MinecraftVersionList(
|
||||
* Gson Adapter that ensure the data in {@link MinecraftVersionList} is sorted correctly when deserializing.
|
||||
*/
|
||||
public static class MinecraftVersionListAdapter implements JsonSerializer<MinecraftVersionList>, JsonDeserializer<MinecraftVersionList> {
|
||||
/**
|
||||
* Gson adapter factory for {@link MinecraftVersionList}.
|
||||
*/
|
||||
public static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newTypeHierarchyFactory(MinecraftVersionList.class, new MinecraftVersionListAdapter());
|
||||
|
||||
private static final TypeToken<Map<String, Integer>> MAP_STR_INT_TYPE = new TypeToken<>() { };
|
||||
|
@@ -216,10 +216,18 @@ public class ProtocolVersion implements Comparable<ProtocolVersion> {
|
||||
return displayOptimizedListOfVersions(List.of(this), finalWordSeparator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first (earliest) Minecraft version that supports this protocol version.
|
||||
* @return the first (earliest) Minecraft version that supports this protocol version.
|
||||
*/
|
||||
public String getFirstVersion() {
|
||||
return versions.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the last (latest) Minecraft version that supports this protocol version.
|
||||
* @return the last (latest) Minecraft version that supports this protocol version.
|
||||
*/
|
||||
public String getLastVersion() {
|
||||
return versions.get(versions.size() - 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user