PluginDependency
Namespace Mc.Scripting · Kind struct (readonly)
public readonly struct PluginDependency : IEquatable<PluginDependency>A dependency declaration of a plugin: the id of the other plugin and an optional version constraint.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
PluginDependency(string Id, string? Constraint) |
A dependency declaration of a plugin: the id of the other plugin and an optional version constraint. |
Constructor
Section titled “Constructor”public PluginDependency(string Id, string? Constraint)A dependency declaration of a plugin: the id of the other plugin and an optional version constraint.
Parameters
| Name | Type | Description |
|---|---|---|
Id |
string |
The other plugin’s id. |
Constraint |
string? |
A version constraint such as “>=1.2”, “^1.2”, “=1.2.3” (null = any version). |
Properties
Section titled “Properties”| Member | Description |
|---|---|
string? Constraint { get; init; } |
A version constraint such as “>=1.2”, “^1.2”, “=1.2.3” (null = any version). |
string Id { get; init; } |
The other plugin’s id. |
Constraint
Section titled “Constraint”public string? Constraint { get; init; }A version constraint such as “>=1.2”, “^1.2”, “=1.2.3” (null = any version).
public string Id { get; init; }The other plugin’s id.
Methods
Section titled “Methods”| Member | Description |
|---|---|
bool Accepts(string version) |
Whether version satisfies the constraint. |
override string ToString() |
|
static PluginDependency Parse(string text) |
Parses “economy” or “economy >=1.2”. |
Accepts
Section titled “Accepts”public bool Accepts(string version)Whether version satisfies the constraint.
Parameters
| Name | Type | Description |
|---|---|---|
version |
string |
A version text such as “1.2.0” or “1.2.0-beta”. |
Returns bool
ToString
Section titled “ToString”public override string ToString()Returns string
public static PluginDependency Parse(string text)Parses “economy” or “economy >=1.2”.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
The text from plugin.json. |
Returns PluginDependency: The dependency.