-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBack.cs
More file actions
32 lines (29 loc) · 1.13 KB
/
Copy pathBack.cs
File metadata and controls
32 lines (29 loc) · 1.13 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
using System.Threading.Tasks;
using Rocket.API.Configuration;
using Rocket.API.DependencyInjection;
using Rocket.API.Eventing;
using Rocket.API.Permissions;
using Rocket.Core.Logging;
using Rocket.Core.Plugins;
namespace Back
{
public class Back : Plugin<BackConfiguration>
{
private readonly IEventBus _eventBus;
private readonly IPermissionChecker _permissionChecker;
private readonly IConfiguration _config;
private BackConfiguration _configuration;
public Back(IDependencyContainer container, IEventBus eventBus, IPermissionChecker permissionChecker, IConfiguration config) : base ("Return to your last death!", container)
{
_eventBus = eventBus;
_permissionChecker = permissionChecker;
_config = config;
}
protected override async Task OnActivate(bool isFromReload)
{
_configuration = _config.Get<BackConfiguration>();
_eventBus.AddEventListener(this, new EventHandler(_permissionChecker, _configuration));
Logger.LogInformation("Back plugin by hiilikewiki loaded!");
}
}
}