Skip to content

Commit 74b3b19

Browse files
add a check for is cancellable in event serhelp
1 parent 27fe211 commit 74b3b19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Code/Plugin/Commands/HelpSystem/DocsProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Reflection;
22
using System.Text;
33
using CommandSystem;
4+
using LabApi.Events.Arguments.Interfaces;
45
using SER.Code.ContextSystem.BaseContexts;
56
using SER.Code.ContextSystem.Interfaces;
67
using SER.Code.Exceptions;
@@ -291,6 +292,7 @@ public static string GetFlagInfo(string flagName)
291292
public static string GetEventInfo(EventInfo ev)
292293
{
293294
var variables = EventSystem.EventHandler.GetMimicVariables(ev);
295+
var cancellable = typeof(ICancellableEvent).IsAssignableFrom(ev.EventHandlerType.GetGenericArguments().FirstOrDefault());
294296
var msg = variables.Count > 0
295297
? variables.Aggregate(
296298
"This event has the following variables attached to it:\n",
@@ -302,6 +304,8 @@ public static string GetEventInfo(EventInfo ev)
302304
$"""
303305
Event {ev.Name} is a part of {ev.DeclaringType?.Name ?? "unknown event group"}.
304306
307+
Is cancellable? {cancellable}
308+
305309
{msg}
306310
""";
307311
}

0 commit comments

Comments
 (0)