Add instruction to get API DLL archived
This commit is contained in:
parent
9aef10ee3f
commit
f3d9147c22
4 changed files with 54 additions and 0 deletions
|
@ -10,6 +10,11 @@ public class PluginSystem
|
|||
|
||||
public static List<PluginContainer> Plugins = new List<PluginContainer>();
|
||||
|
||||
private static void PSysLog(string Message)
|
||||
{
|
||||
Console.WriteLine($"[PLUGINS] {Message}");
|
||||
}
|
||||
|
||||
public static void InitializeSystem(string pluginDirectory)
|
||||
{
|
||||
CompoundTag pluginsData = new CompoundTag();
|
||||
|
@ -38,11 +43,14 @@ public class PluginSystem
|
|||
plugin.Initialize();
|
||||
nPlugin.plugin = plugin;
|
||||
|
||||
|
||||
ForgeCorePluginAttribute attrib = types.GetCustomAttribute<ForgeCorePluginAttribute>();
|
||||
|
||||
Tag? pluginStore = pluginsData.Get(attrib.pluginName);
|
||||
nPlugin.pluginName = attrib.pluginName;
|
||||
|
||||
PSysLog($"> Loading plugin: {nPlugin.pluginName}");
|
||||
|
||||
|
||||
if (pluginStore == null)
|
||||
{
|
||||
|
@ -54,15 +62,19 @@ public class PluginSystem
|
|||
CompoundTag dataTag = tag["data"] as CompoundTag;
|
||||
|
||||
plugin.LoadConfig(dataTag);
|
||||
PSysLog($"> Loaded plugin: {nPlugin.pluginName}");
|
||||
if (NbtUtils.ReadBoolean(tag, "enabled"))
|
||||
{
|
||||
nPlugin.enabled = true;
|
||||
plugin.Enable();
|
||||
|
||||
PSysLog($"> Enabled plugin: {nPlugin.pluginName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.Disable();
|
||||
nPlugin.enabled = false;
|
||||
PSysLog($"> Disabled plugin: {nPlugin.pluginName}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue