Skip to content

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.

Member Description
PluginDependency(string Id, string? Constraint) A dependency declaration of a plugin: the id of the other plugin and an optional version constraint.
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).
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.
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.

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”.
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

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.