Added event for reloading configs, so when a user does /reload it informs plugins that a config reload is requested.
This commit is contained in:
parent
b37552ff27
commit
e37ada8749
3 changed files with 34 additions and 2 deletions
30
TShockAPI/Hooks/GeneralHooks.cs
Normal file
30
TShockAPI/Hooks/GeneralHooks.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace TShockAPI.Hooks
|
||||
{
|
||||
public class ReloadEventArgs
|
||||
{
|
||||
public TSPlayer Player { get; set; }
|
||||
public ReloadEventArgs(TSPlayer ply)
|
||||
{
|
||||
Player = ply;
|
||||
}
|
||||
}
|
||||
|
||||
public class GeneralHooks
|
||||
{
|
||||
public delegate void ReloadEventD(ReloadEventArgs e);
|
||||
public static event ReloadEventD ReloadEvent;
|
||||
|
||||
public static void OnReloadEvent(TSPlayer ply)
|
||||
{
|
||||
if(ReloadEvent == null)
|
||||
return;
|
||||
|
||||
ReloadEvent(new ReloadEventArgs(ply));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue