Class ViewFrame

java.lang.Object
me.devnatan.inventoryframework.IFViewFrame<ViewFrame,View>
me.devnatan.inventoryframework.ViewFrame

public class ViewFrame extends me.devnatan.inventoryframework.IFViewFrame<ViewFrame,View>
  • Field Summary

    Fields inherited from class me.devnatan.inventoryframework.IFViewFrame

    defaultConfig, FRAME_REGISTERED, FRAME_UNREGISTERED, registeredViews, viewerById
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull ViewFrame
    create(@NotNull org.bukkit.plugin.Plugin owner)
    Creates a new ViewFrame.
    final ViewFrame
    Disables bStats metrics tracking.
    final @NotNull org.bukkit.plugin.Plugin
     
    final me.devnatan.inventoryframework.Viewer
    getViewer(@NotNull org.bukkit.entity.Player player)
    This is an internal inventory-framework API that should not be used from outside of this library.
    final @NotNull ViewFrame
    install(@NotNull me.devnatan.inventoryframework.feature.Feature<?,?,ViewFrame> feature)
    Installs a feature with no specific configuration.
    final <C, R> ViewFrame
    install(@NotNull me.devnatan.inventoryframework.feature.Feature<C,R,ViewFrame> feature, @NotNull UnaryOperator<C> configure)
    Installs a feature.
    final String
    open(@NotNull Class<? extends View> viewClass, @NotNull Collection<? extends org.bukkit.entity.Player> players)
    Opens a view to more than one player.
    final String
    open(@NotNull Class<? extends View> viewClass, @NotNull Collection<? extends org.bukkit.entity.Player> players, Object initialData)
    Opens a view to more than one player with initial data.
    final String
    open(@NotNull Class<? extends View> viewClass, @NotNull org.bukkit.entity.Player player)
    Opens a view to a player.
    final String
    open(@NotNull Class<? extends View> viewClass, @NotNull org.bukkit.entity.Player player, Object initialData)
    Opens a view to a player with initial data.
    final void
    openActive(@NotNull Class<? extends View> viewClass, @NotNull String contextId, @NotNull org.bukkit.entity.Player player)
    Opens an already active context to a player.
    final void
    openActive(@NotNull Class<? extends View> viewClass, @NotNull String contextId, @NotNull org.bukkit.entity.Player player, Object initialData)
    Opens an already active context to a player.
    final void
    openEndless(@NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull org.bukkit.entity.Player player)
    Opens an already active context to a player.
    final void
    openEndless(@NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull org.bukkit.entity.Player player, Object initialData)
    Opens an already active context to a player.
    final ViewFrame
     
    final void
     

    Methods inherited from class me.devnatan.inventoryframework.IFViewFrame

    addViewer, createEndlessContext, createEndlessContext, defaultConfig, enableDebug, getDefaultConfig, getPipeline, getRegisteredViewByType, getRegisteredViews, internalOpen, internalOpenActiveContext, isRegistered, remove, removeViewer, setRegistered, with

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getOwner

      @NotNull public final @NotNull org.bukkit.plugin.Plugin getOwner()
    • open

      public final String open(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull org.bukkit.entity.Player player)
      Opens a view to a player.
      Parameters:
      viewClass - The target view to be opened.
      player - The player that the view will be open to.
      Returns:
      The id of the newly created IFContext.
    • open

      public final String open(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull org.bukkit.entity.Player player, Object initialData)
      Opens a view to a player with initial data.
      Parameters:
      viewClass - The target view to be opened.
      player - The player that the view will be open to.
      initialData - The initial data.
      Returns:
      The id of the newly created IFContext.
    • open

      @Experimental public final String open(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull Collection<? extends org.bukkit.entity.Player> players)
      Opens a view to more than one player.

      These players will see the same inventory and share the same context.

      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:
      viewClass - The target view to be opened.
      players - The players that the view will be open to.
      Returns:
      The id of the newly created IFContext.
    • open

      @Experimental public final String open(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull Collection<? extends org.bukkit.entity.Player> players, Object initialData)
      Opens a view to more than one player with initial data.

      These players will see the same inventory and share the same context.

      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:
      viewClass - The target view to be opened.
      players - The players that the view will be open to.
      initialData - The initial data.
      Returns:
      The id of the newly created IFContext.
    • openActive

      @Experimental public final void openActive(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull String contextId, @NotNull @NotNull org.bukkit.entity.Player player)
      Opens an already active context to a 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.

      Parameters:
      contextId - The id of the context.
      player - Who the context will be open to.
    • openActive

      @Experimental public final void openActive(@NotNull @NotNull Class<? extends View> viewClass, @NotNull @NotNull String contextId, @NotNull @NotNull org.bukkit.entity.Player player, Object initialData)
      Opens an already active context to a 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.

      Parameters:
      contextId - The id of the context.
      player - Who the context will be open to.
      initialData - Initial data to pass to PlatformView.onViewerAdded(IFContext, Object, Object).
    • openEndless

      @Experimental public final void openEndless(@NotNull @NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull @NotNull org.bukkit.entity.Player player)
      Opens an already active context to a 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.

      Parameters:
      endlessContextInfo - The id of the context.
      player - Who the context will be open to.
    • openEndless

      @Experimental public final void openEndless(@NotNull @NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull @NotNull org.bukkit.entity.Player player, Object initialData)
      Opens an already active context to a 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.

      Parameters:
      endlessContextInfo - The id of the context.
      player - Who the context will be open to.
      initialData - Initial data to pass to PlatformView.onViewerAdded(IFContext, Object, Object).
    • register

      public final ViewFrame register()
      Specified by:
      register in class me.devnatan.inventoryframework.IFViewFrame<ViewFrame,View>
    • unregister

      public final void unregister()
      Specified by:
      unregister in class me.devnatan.inventoryframework.IFViewFrame<ViewFrame,View>
    • getViewer

      @Internal public final me.devnatan.inventoryframework.Viewer getViewer(@NotNull @NotNull org.bukkit.entity.Player player)
      This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
    • create

      @NotNull public static @NotNull ViewFrame create(@NotNull @NotNull org.bukkit.plugin.Plugin owner)
      Creates a new ViewFrame.
      Parameters:
      owner - The plugin that owns this view frame.
      Returns:
      A new ViewFrame instance.
    • install

      public final <C, R> ViewFrame install(@NotNull @NotNull me.devnatan.inventoryframework.feature.Feature<C,R,ViewFrame> feature, @NotNull @NotNull UnaryOperator<C> configure)
      Installs a feature.
      Type Parameters:
      C - The feature configuration type.
      R - The feature value instance type.
      Parameters:
      feature - The feature to be installed.
      configure - The feature configuration.
      Returns:
      An instance of the installed feature.
    • install

      @NotNull public final @NotNull ViewFrame install(@NotNull @NotNull me.devnatan.inventoryframework.feature.Feature<?,?,ViewFrame> feature)
      Installs a feature with no specific configuration.
      Parameters:
      feature - The feature to be installed.
      Returns:
      This view frame.
    • disableMetrics

      public final ViewFrame disableMetrics()
      Disables bStats metrics tracking.

      InventoryFramework use bStats metrics to obtain some information from servers that use it as a library, such as: number of players, version, software, etc.

      **No sensitive information is tracked.**

      Returns:
      This view frame.