Class ViewFrame
-
Field Summary
Fields inherited from class me.devnatan.inventoryframework.IFViewFrame
defaultConfig, FRAME_REGISTERED, FRAME_UNREGISTERED, registeredViews, viewerById -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ViewFramecreate(@NotNull org.bukkit.plugin.Plugin owner) Creates a new ViewFrame.final ViewFrameDisables bStats metrics tracking.final @NotNull org.bukkit.plugin.PlugingetOwner()final me.devnatan.inventoryframework.ViewergetViewer(@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 ViewFrameInstalls 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 Stringopen(@NotNull Class<? extends View> viewClass, @NotNull Collection<? extends org.bukkit.entity.Player> players) Opens a view to more than one player.final Stringopen(@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 StringOpens a view to a player.final Stringopen(@NotNull Class<? extends View> viewClass, @NotNull org.bukkit.entity.Player player, Object initialData) Opens a view to a player with initial data.final voidopenActive(@NotNull Class<? extends View> viewClass, @NotNull String contextId, @NotNull org.bukkit.entity.Player player) Opens an already active context to a player.final voidopenActive(@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 voidopenEndless(@NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull org.bukkit.entity.Player player) Opens an already active context to a player.final voidopenEndless(@NotNull me.devnatan.inventoryframework.context.EndlessContextInfo endlessContextInfo, @NotNull org.bukkit.entity.Player player, Object initialData) Opens an already active context to a player.final ViewFrameregister()final voidMethods inherited from class me.devnatan.inventoryframework.IFViewFrame
addViewer, createEndlessContext, createEndlessContext, defaultConfig, enableDebug, getDefaultConfig, getPipeline, getRegisteredViewByType, getRegisteredViews, internalOpen, internalOpenActiveContext, isRegistered, remove, removeViewer, setRegistered, with
-
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 toPlatformView.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 toPlatformView.onViewerAdded(IFContext, Object, Object).
-
register
-
unregister
public final void unregister() -
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
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
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.
-