Class TriggerContext

java.lang.Object
com.ultikits.ultitools.manager.TriggerContext

@Internal public final class TriggerContext extends Object
Immutable context describing what triggered an error. All player info is captured as strings at construction time to be safe across async thread boundaries.
Since:
6.2.3
  • Field Details

  • Constructor Details

  • Method Details

    • command

      public static TriggerContext command(org.bukkit.command.CommandSender sender, String commandLine)
      Create context for a command trigger. Captures player info immediately (safe for async use).
      Parameters:
      sender - the command sender
      commandLine - the full command line (e.g., "uc msg Hello")
      Returns:
      trigger context
    • event

      public static TriggerContext event(String eventClassName)
      Create context for an event trigger.
      Parameters:
      eventClassName - the simple name of the event class
      Returns:
      trigger context
    • aop

      public static TriggerContext aop(String className, String methodName)
      Create context for an AOP interceptor trigger.
      Parameters:
      className - the simple name of the declaring class
      methodName - the method name
      Returns:
      trigger context
    • scheduled

      public static TriggerContext scheduled(String detail)
      Create context for a scheduled task trigger.
      Parameters:
      detail - description of the scheduled task
      Returns:
      trigger context
    • uncaught

      public static TriggerContext uncaught(String detail)
      Create context for an uncaught exception.
      Parameters:
      detail - description of where the error occurred
      Returns:
      trigger context
    • getTriggerType

      public TriggerContext.TriggerType getTriggerType()
    • getTriggerDetail

      public String getTriggerDetail()
    • getPlayerName

      public String getPlayerName()
    • getPlayerUUID

      public String getPlayerUUID()