ApiVersion
Namespace Mc.Scripting · Kind struct (readonly)
public readonly struct ApiVersion : IComparable<ApiVersion>, IEquatable<ApiVersion>The version of the plugin API (semantic: a minor increase is additive, a major increase is breaking).
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
ApiVersion(int Major, int Minor) |
The version of the plugin API (semantic: a minor increase is additive, a major increase is breaking). |
Constructor
Section titled “Constructor”public ApiVersion(int Major, int Minor)The version of the plugin API (semantic: a minor increase is additive, a major increase is breaking).
Parameters
| Name | Type | Description |
|---|---|---|
Major |
int |
Breaking changes. |
Minor |
int |
Additive changes. |
Properties
Section titled “Properties”| Member | Description |
|---|---|
int Major { get; init; } |
Breaking changes. |
int Minor { get; init; } |
Additive changes. |
static ApiVersion Current { get; } |
The API version this server provides. |
public int Major { get; init; }Breaking changes.
public int Minor { get; init; }Additive changes.
Current
Section titled “Current”public static ApiVersion Current { get; }The API version this server provides.
Methods
Section titled “Methods”| Member | Description |
|---|---|
int CompareTo(ApiVersion other) |
|
bool Satisfies(ApiVersion required) |
Whether a plugin that needs required can run on this server version. |
override string ToString() |
|
static bool TryParse(string? text, out ApiVersion version) |
Parses “1.0”, “1” or “1.x”. |
CompareTo
Section titled “CompareTo”public int CompareTo(ApiVersion other)Parameters
| Name | Type | Description |
|---|---|---|
other |
ApiVersion |
Returns int
Satisfies
Section titled “Satisfies”public bool Satisfies(ApiVersion required)Whether a plugin that needs required can run on this server version.
Parameters
| Name | Type | Description |
|---|---|---|
required |
ApiVersion |
Returns bool
ToString
Section titled “ToString”public override string ToString()Returns string
TryParse
Section titled “TryParse”public static bool TryParse(string? text, out ApiVersion version)Parses “1.0”, “1” or “1.x”.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string? |
The text. |
version |
out ApiVersion |
The result. |
Returns bool: True when the text is a valid version.