Interface StockEvent.Cause

All Known Subinterfaces:
StickCause
All Known Implementing Classes:
CommandCauses.AdminGive, CommandCauses.AdminReset, CommandCauses.AdminSet, CommandCauses.AdminTake, CommandCauses.Give, CommandCauses.Receive, CraftCause, GuiCauses.Deposit, GuiCauses.Withdraw, StickCauses.BlockItem, StickCauses.BlockPlace, StickCauses.Brewer, StickCauses.Container, StickCauses.Furnace, StickCauses.ItemBreak, StickCauses.ItemConsume, StickCauses.ProjectileLaunch, StickCauses.ShootBow
Enclosing class:
StockEvent

public static interface StockEvent.Cause
An interface that indicates why the StockEvent was called.

By implementing this interface, StockEvent.Cause can have additional information.

If no additional information is needed, an instance can be created via create(String).

  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull StockEvent.Cause
    create(@NotNull String name)
    Creates the simple implementation of StockEvent.Cause that implements name()
    @NotNull String
    Gets the string that indicates the cause.
  • Method Details

    • create

      @NotNull static @NotNull StockEvent.Cause create(@NotNull @NotNull String name)
      Creates the simple implementation of StockEvent.Cause that implements name()
      Parameters:
      name - the cause that indicates why the StockEvent was called
      Returns:
      a StockEvent.Cause instance
    • name

      @NotNull @NotNull String name()
      Gets the string that indicates the cause.

      This method returns a string that is a concise representation of the "cause".

      For example, an API call is "api", and a player's stock deposit/withdrawal is "deposit" or "withdraw".

      Returns:
      the string that indicates the cause