Interface Context

All Superinterfaces:
me.devnatan.inventoryframework.component.ComponentContainer, me.devnatan.inventoryframework.context.IFConfinedContext, me.devnatan.inventoryframework.context.IFContext, Iterable<me.devnatan.inventoryframework.component.Component>, me.devnatan.inventoryframework.state.StateValueHost, me.devnatan.inventoryframework.VirtualView
All Known Implementing Classes:
CloseContext, OpenContext, RenderContext, SlotClickContext, SlotContext, SlotRenderContext

public interface Context extends me.devnatan.inventoryframework.context.IFConfinedContext
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.bukkit.entity.Player>
    This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.
    @UnknownNullability org.bukkit.entity.Player
    The player for the current interaction context.
    void
    resetTitleForPlayer(@NotNull org.bukkit.entity.Player player)
    Resets the container title only for the player current scope of execution to the initially defined title.
    void
    updateTitleForPlayer(@NotNull String title, @NotNull org.bukkit.entity.Player player)
    Updates the container title for a specific player.

    Methods inherited from interface me.devnatan.inventoryframework.component.ComponentContainer

    getComponents, getInternalComponents

    Methods inherited from interface me.devnatan.inventoryframework.context.IFConfinedContext

    back, back, canBack, closeForPlayer, getViewer, openForPlayer, openForPlayer, resetTitleForPlayer, updateTitleForPlayer, updateTitleForPlayer

    Methods inherited from interface me.devnatan.inventoryframework.context.IFContext

    addComponent, addViewer, closeForEveryone, getComponentsAt, getConfig, getId, getIndexedViewers, getInitialData, getInitialTitle, getRoot, getViewers, isActive, isEndless, isShared, openForEveryone, openForEveryone, performClickInComponent, removeComponent, removeViewer, renderComponent, resetTitleForEveryone, setActive, setEndless, setInitialData, update, updateComponent, updateTitleForEveryone, updateTitleForEveryone

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator

    Methods inherited from interface me.devnatan.inventoryframework.state.StateValueHost

    getInternalStateValue, getRawStateValue, getStateValues, getUninitializedStateValue, initializeState, updateState, watchState
  • Method Details

    • getPlayer

      @UnknownNullability org.bukkit.entity.Player getPlayer()
      The player for the current interaction context.

      Contexts can be shared and contain multiple viewers, this method will always return the player for the current event.

      Returns:
      A player in this interaction context.
    • getAllPlayers

      @Experimental List<org.bukkit.entity.Player> getAllPlayers()

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

    • updateTitleForPlayer

      @Experimental void updateTitleForPlayer(@NotNull @NotNull String title, @NotNull @NotNull org.bukkit.entity.Player player)
      Updates the container title for a specific player.

      This should not be used before the container is opened, if you need to set the __initial title__ use IFOpenContext.modifyConfig() on open handler instead.

      This method is version dependant, so it may be that your server version is not yet supported, if you try to use this method and fail (can fail silently), report it to the library developers to add support to your version.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      title - The new container title.
      player - The player to update the title.
    • resetTitleForPlayer

      @Experimental void resetTitleForPlayer(@NotNull @NotNull org.bukkit.entity.Player player)
      Resets the container title only for the player current scope of execution to the initially defined title. Must be used after updateTitleForPlayer(String, Player) to take effect.

      This API is experimental and is not subject to the general compatibility guarantees such API may be changed or may be removed completely in any further release.

      Parameters:
      player - The player to reset the title.