PluginMetadata
Namespace Mc.Scripting · Kind class (sealed)
public sealed class PluginMetadataWhat a plugin declares about itself: from plugin.json, or from PluginInfoAttribute when there is no manifest.
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
PluginMetadata(string id, string name, string version) |
Creates metadata (the runtime does this; plugins read it from PluginContext.Info). |
Constructor
Section titled “Constructor”public PluginMetadata(string id, string name, string version)Creates metadata (the runtime does this; plugins read it from PluginContext.Info).
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
|
name |
string |
|
version |
string |
Properties
Section titled “Properties”| Member | Description |
|---|---|
ApiVersion Api { get; init; } |
The plugin API version the plugin was written for. |
bool ApiDeclared { get; init; } |
Whether the manifest named an API version (otherwise 1.0 was assumed). |
IReadOnlyList<string> Authors { get; init; } |
The author names. |
IReadOnlyList<PluginDependency> Depends { get; init; } |
Plugins that must be loaded (and enabled) before this one; a missing one prevents this plugin from loading. |
string Description { get; init; } |
A one-line description. |
string Id { get; } |
Unique id: lower case letters, digits, ‘-’ and ‘_’ (1-32 characters). |
IReadOnlyList<string> LoadBefore { get; init; } |
Plugins that should be loaded after this one (the reverse of a soft dependency). |
string? Main { get; init; } |
The full name of the plugin class when the assembly has several candidates (default: the single public IPlugin). |
string Name { get; } |
Display name (used as the log prefix). |
IReadOnlyList<PluginDependency> SoftDepends { get; init; } |
Plugins that are loaded before this one when present. |
string Source { get; init; } |
The path of the manifest or assembly this was read from. |
string Version { get; } |
Plugin version. |
string Website { get; init; } |
A website or repository url. |
public ApiVersion Api { get; init; }The plugin API version the plugin was written for.
ApiDeclared
Section titled “ApiDeclared”public bool ApiDeclared { get; init; }Whether the manifest named an API version (otherwise 1.0 was assumed).
Authors
Section titled “Authors”public IReadOnlyList<string> Authors { get; init; }The author names.
Depends
Section titled “Depends”public IReadOnlyList<PluginDependency> Depends { get; init; }Plugins that must be loaded (and enabled) before this one; a missing one prevents this plugin from loading.
Description
Section titled “Description”public string Description { get; init; }A one-line description.
public string Id { get; }Unique id: lower case letters, digits, ‘-’ and ‘_’ (1-32 characters). Also the data folder name.
LoadBefore
Section titled “LoadBefore”public IReadOnlyList<string> LoadBefore { get; init; }Plugins that should be loaded after this one (the reverse of a soft dependency).
public string? Main { get; init; }The full name of the plugin class when the assembly has several candidates (default: the single public IPlugin).
public string Name { get; }Display name (used as the log prefix).
SoftDepends
Section titled “SoftDepends”public IReadOnlyList<PluginDependency> SoftDepends { get; init; }Plugins that are loaded before this one when present.
Source
Section titled “Source”public string Source { get; init; }The path of the manifest or assembly this was read from.
Version
Section titled “Version”public string Version { get; }Plugin version.
Website
Section titled “Website”public string Website { get; init; }A website or repository url.
Methods
Section titled “Methods”| Member | Description |
|---|---|
static bool IsValidId(string id) |
Whether id is a valid plugin id. |
IsValidId
Section titled “IsValidId”public static bool IsValidId(string id)Whether id is a valid plugin id.
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The text. |
Returns bool