Interface MenuConditionContext
public interface MenuConditionContext
What an add-on condition, value or resolver is asked about: one viewer, the menu they are
opening or looking at, and the moment the menu is being decided.
A context is only valid during the call it is passed to, which always runs on the main thread. Keep the work quick: it runs every time the menu opens or redraws.
- Since:
- 1.15.0
-
Method Summary
Modifier and TypeMethodDescription@NotNull MenuViewgetMenu()What the menu shows right now.default @NotNull StringThe menu's ID inguis.yml; the same asgetMenu().menuId().@NotNull ZonedDateTimegetNow()The moment the menu is being decided, in the time zone ofbackgrounds.timezoneinguis.yml(the server's own when unset).@NotNull org.bukkit.entity.PlayerThe player looking at the menu.
-
Method Details
-
getPlayer
@NotNull @NotNull org.bukkit.entity.Player getPlayer()The player looking at the menu. -
getMenu
What the menu shows right now. Itsbackgroundis null, because the background is what is being decided. -
getMenuId
The menu's ID inguis.yml; the same asgetMenu().menuId(). -
getNow
The moment the menu is being decided, in the time zone ofbackgrounds.timezoneinguis.yml(the server's own when unset). It is the same for every condition of one decision.
-