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 ClassesModifier and TypeInterfaceDescriptionstatic final recordAn immutable non-player identity.static final recordAn immutable player identity. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StockActorThe built-in actor for the server console. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull StockActor.PlayerfromPlayer(@NotNull Player player) Captures a player's identity without retaining the Bukkit player.static @NotNull StockActorfromSender(@NotNull CommandSender sender) Captures the sender's identity.@NotNull Stringname()Returns the actor's name when the change was initiated.@Nullable UUIDuuid()Returns the actor's UUID, ornullif it has none.
-
Field Details
-
CONSOLE
The built-in actor for the server console.
-
-
Method Details
-
fromPlayer
Captures a player's identity without retaining the Bukkit player.- Parameters:
player- the initiating player- Returns:
- the captured identity
-
fromSender
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
Returns the actor's UUID, ornullif 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
Returns the actor's name when the change was initiated.- Returns:
- the actor's name
-