Interface StockActor

All Known Implementing Classes:
StockActor.Other, StockActor.Player

public interface StockActor
The initiator of a stock change, independent of the stock holder. Implementations should supply captured values rather than consult live server state, because stock events may be delivered asynchronously.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    An immutable non-player identity.
    static final record 
    An immutable player identity.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final StockActor
    The built-in actor for the server console.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull StockActor.Player
    fromPlayer(@NotNull Player player)
    Captures a player's identity without retaining the Bukkit player.
    static @NotNull StockActor
    fromSender(@NotNull CommandSender sender)
    Captures the sender's identity.
    @NotNull String
    Returns the actor's name when the change was initiated.
    @Nullable UUID
    Returns the actor's UUID, or null if it has none.
  • Field Details

    • CONSOLE

      static final StockActor CONSOLE
      The built-in actor for the server console.
  • Method Details

    • fromPlayer

      @NotNull static @NotNull StockActor.Player fromPlayer(@NotNull Player player)
      Captures a player's identity without retaining the Bukkit player.
      Parameters:
      player - the initiating player
      Returns:
      the captured identity
    • fromSender

      @NotNull static @NotNull StockActor fromSender(@NotNull @NotNull CommandSender sender)
      Captures the sender's identity. Other than players and consoles, senders are represented by name only.
      Parameters:
      sender - the initiating command sender
      Returns:
      the captured identity
    • uuid

      @Nullable @Nullable UUID uuid()
      Returns the actor's UUID, or null if it has none. A player actor always has a UUID, but other actors may have one too.
      Returns:
      the actor's UUID, if available
    • name

      @NotNull @NotNull String name()
      Returns the actor's name when the change was initiated.
      Returns:
      the actor's name