-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
77 lines (63 loc) · 2.14 KB
/
Plugin.cs
File metadata and controls
77 lines (63 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// -----------------------------------------------------------------------
// <copyright file="Plugin.cs" company="Redforce04">
// Copyright (c) Redforce04. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------
namespace BananaLibrary;
using System;
using API.Utils;
using LabApi.Features;
using LabApi.Loader.Features.Plugins.Enums;
/// <summary>
/// The main plugin for loading the banana api interface.
/// </summary>
// ReSharper disable ClassNeverInstantiated.Global
public sealed class Plugin : LabApi.Loader.Features.Plugins.Plugin<Config>
{
static Plugin()
{
CosturaUtility.Initialize();
}
/// <summary>
/// Initializes a new instance of the <see cref="Plugin"/> class.
/// </summary>
public Plugin()
{
}
/// <summary>
/// Gets the primary instance of the Banana Library Plugin. This will be null if the plugin is not currently loaded.
/// </summary>
public static Plugin? Instance { get; private set; }
/// <inheritdoc/>
public override string Name => "BananaLibrary";
/// <inheritdoc/>
public override string Description => "An API for modularized server features.";
/// <inheritdoc/>
public override string Author => "O5Zereth and Redforce04";
/// <inheritdoc/>
public override Version RequiredApiVersion => LabApiProperties.CurrentVersion;
/// <inheritdoc/>
public override LoadPriority Priority => LoadPriority.Lowest;
/// <inheritdoc/>
public override Version Version => Version.Parse("1.0.0");
/// <inheritdoc/>
public override void Enable()
{
Instance = this;
this.LoadConfigs();
Log.AddAssemblyToDebug(typeof(Plugin).Assembly, this.Config!.Debug);
Loader.Initialize();
Log.Info($"Loaded BananaFramework v{this.Version} {(this.Config?.Debug ?? false ? "[Debug]" : string.Empty)}");
}
/// <inheritdoc/>
public override void Disable()
{
Loader.Unload();
Instance = null;
}
private void ThrowException()
{
throw new Exception($"Test exception.");
}
}