Class CommandExecutionIdentity

java.lang.Object
dev.plex.api.command.CommandExecutionIdentity

@Internal public final class CommandExecutionIdentity extends Object
Carries an attributed command name through a synchronous Plex command dispatch.
  • Method Details

    • call

      public static <T> T call(@Nullable @Nullable UUID uniqueId, @Nullable @Nullable String name, Supplier<T> action)
      Runs an action with a temporary command identity.
      Type Parameters:
      T - result type
      Parameters:
      uniqueId - actor UUID, or null
      name - actor name, or null
      action - action to run
      Returns:
      action result
    • currentName

      public static String currentName(String fallback)
      Returns the current actor name.
      Parameters:
      fallback - value to use when no name is set
      Returns:
      current actor name or the fallback value
    • currentUniqueId

      @Nullable public static @Nullable UUID currentUniqueId()
      Returns the current actor UUID.
      Returns:
      current actor UUID, or null when no UUID is set