Class RenderContext
- All Implemented Interfaces:
Iterable<me.devnatan.inventoryframework.component.Component>,me.devnatan.inventoryframework.component.ComponentContainer,Context,me.devnatan.inventoryframework.context.IFConfinedContext,me.devnatan.inventoryframework.context.IFContext,me.devnatan.inventoryframework.context.IFRenderContext,me.devnatan.inventoryframework.state.StateValueHost,me.devnatan.inventoryframework.VirtualView,org.bukkit.inventory.InventoryHolder
-
Field Summary
Fields inherited from class me.devnatan.inventoryframework.context.PlatformRenderContext
root -
Constructor Summary
ConstructorsConstructorDescriptionRenderContext(@NotNull UUID id, @NotNull View root, @NotNull me.devnatan.inventoryframework.ViewConfig config, me.devnatan.inventoryframework.ViewContainer container, @NotNull Map<String, me.devnatan.inventoryframework.Viewer> viewers, me.devnatan.inventoryframework.Viewer subject, Object initialData) This is an internal inventory-framework API that should not be used from outside of this library. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(me.devnatan.inventoryframework.component.Component arg0) final voidaddViewer(me.devnatan.inventoryframework.Viewer arg0) @NotNull BukkitItemComponentBuilderavailableSlot(@Nullable org.bukkit.inventory.ItemStack item) Adds an item in the next available slot of this context's container.protected BukkitItemComponentBuilderboolean@NotNull BukkitItemComponentBuilderfirstSlot(@Nullable org.bukkit.inventory.ItemStack item) Sets an item in the first slot of this context's container.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.List<me.devnatan.inventoryframework.component.Component> List<me.devnatan.inventoryframework.component.Component> getComponentsAt(int arg0) final StringList<me.devnatan.inventoryframework.component.Component> @NotNull org.bukkit.inventory.Inventory@NotNull org.bukkit.entity.PlayerThe player for the current interaction context.@NotNull ViewgetRoot()final List<me.devnatan.inventoryframework.Viewer> inthashCode()final booleanisShared()final Iterator<me.devnatan.inventoryframework.component.Component> iterator()@NotNull BukkitItemComponentBuilderlastSlot(@Nullable org.bukkit.inventory.ItemStack item) Sets an item in the last slot of this context's container.@NotNull BukkitItemComponentBuilderlayoutSlot(char character, @Nullable org.bukkit.inventory.ItemStack item) Defines the item that will represent a character provided in the context layout.voidperformClickInComponent(me.devnatan.inventoryframework.component.Component arg0, me.devnatan.inventoryframework.Viewer arg1, me.devnatan.inventoryframework.ViewContainer arg2, Object arg3, int arg4, boolean arg5) voidremoveComponent(me.devnatan.inventoryframework.component.Component arg0) final voidremoveViewer(me.devnatan.inventoryframework.Viewer arg0) voidrenderComponent(me.devnatan.inventoryframework.component.Component arg0) voidresetTitleForPlayer(@NotNull org.bukkit.entity.Player player) Resets the container title only for the player current scope of execution to the initially defined title.@NotNull BukkitItemComponentBuilderresultSlot(@Nullable org.bukkit.inventory.ItemStack item) 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.@NotNull BukkitItemComponentBuilderslot(int row, int column, @Nullable org.bukkit.inventory.ItemStack item) Adds an item at the specific column and ROW (X, Y) in that context's container.@NotNull BukkitItemComponentBuilderslot(int slot, @Nullable org.bukkit.inventory.ItemStack item) Adds an item to a specific slot in the context container.toString()(package private) final void(package private) final voidvoidupdate()voidupdateComponent(me.devnatan.inventoryframework.component.Component arg0, boolean arg1) voidupdateTitleForPlayer(@NotNull String title, @NotNull org.bukkit.entity.Player player) Updates the container title for a specific player.Methods inherited from class me.devnatan.inventoryframework.context.PlatformRenderContext
addLayoutSlot, availableSlot, availableSlot, closeForPlayer, createRegisteredBuilder, firstSlot, getAvailableSlotFactories, getComponentFactories, getConfig, getContainer, getId, getIndexedViewers, getInitialData, getLayoutSlots, getViewer, isRendered, lastSlot, layoutSlot, layoutSlot, openForPlayer, openForPlayer, resetTitleForPlayer, resultSlot, setContainer, setInitialData, setRendered, slot, slot, unsetSlot, updateTitleForPlayer, updateTitleForPlayerMethods inherited from class me.devnatan.inventoryframework.context.PlatformConfinedContext
back, back, canBackMethods inherited from class me.devnatan.inventoryframework.context.PlatformContext
closeForEveryone, getContainerOrThrow, getTitle, getUpdatedTitle, isActive, isEndless, openForEveryone, openForEveryone, resetTitleForEveryone, setActive, setEndless, updateTitleForEveryone, updateTitleForEveryoneMethods inherited from class me.devnatan.inventoryframework.state.DefaultStateValueHost
getInternalStateValue, getRawStateValue, getStateValues, getUninitializedStateValue, initializeState, updateState, watchStateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface me.devnatan.inventoryframework.component.ComponentContainer
getComponents, getInternalComponentsMethods inherited from interface me.devnatan.inventoryframework.context.IFConfinedContext
back, back, canBack, closeForPlayer, getViewer, openForPlayer, openForPlayer, resetTitleForPlayer, updateTitleForPlayer, updateTitleForPlayerMethods inherited from interface me.devnatan.inventoryframework.context.IFContext
addComponent, addViewer, closeForEveryone, getComponentsAt, getConfig, getId, getIndexedViewers, getInitialData, getInitialTitle, getViewers, isActive, isEndless, isShared, openForEveryone, openForEveryone, performClickInComponent, removeComponent, removeViewer, renderComponent, resetTitleForEveryone, setActive, setEndless, setInitialData, update, updateComponent, updateTitleForEveryone, updateTitleForEveryoneMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface me.devnatan.inventoryframework.state.StateValueHost
getInternalStateValue, getRawStateValue, getStateValues, getUninitializedStateValue, initializeState, updateState, watchState
-
Constructor Details
-
RenderContext
@Internal public RenderContext(@NotNull @NotNull UUID id, @NotNull @NotNull View root, @NotNull @NotNull me.devnatan.inventoryframework.ViewConfig config, me.devnatan.inventoryframework.ViewContainer container, @NotNull @NotNull Map<String, me.devnatan.inventoryframework.Viewer> viewers, me.devnatan.inventoryframework.Viewer subject, Object initialData) This is an internal inventory-framework API that should not be used from outside of this library. No compatibility guarantees are provided.
-
-
Method Details
-
getRoot
- Specified by:
getRootin interfaceme.devnatan.inventoryframework.context.IFContext- Specified by:
getRootin classme.devnatan.inventoryframework.context.PlatformContext
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()Description copied from interface:ContextThe 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.
-
getAllPlayers
Description copied from interface:ContextThis 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.
- Specified by:
getAllPlayersin interfaceContext
-
updateTitleForPlayer
public void updateTitleForPlayer(@NotNull @NotNull String title, @NotNull @NotNull org.bukkit.entity.Player player) Description copied from interface:ContextUpdates 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.
- Specified by:
updateTitleForPlayerin interfaceContext- Parameters:
title- The new container title.player- The player to update the title.
-
resetTitleForPlayer
public void resetTitleForPlayer(@NotNull @NotNull org.bukkit.entity.Player player) Description copied from interface:ContextResets the container title only for the player current scope of execution to the initially defined title. Must be used afterContext.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.
- Specified by:
resetTitleForPlayerin interfaceContext- Parameters:
player- The player to reset the title.
-
slot
@NotNull public @NotNull BukkitItemComponentBuilder slot(int slot, @Nullable @Nullable org.bukkit.inventory.ItemStack item) Adds an item to a specific slot in the context container.- Parameters:
slot- The slot in which the item will be positioned.- Returns:
- An item builder to configure the item.
-
slot
@NotNull public @NotNull BukkitItemComponentBuilder slot(int row, int column, @Nullable @Nullable org.bukkit.inventory.ItemStack item) Adds an item at the specific column and ROW (X, Y) in that context's container.- Parameters:
row- The row (Y) in which the item will be positioned.column- The column (X) in which the item will be positioned.- Returns:
- An item builder to configure the item.
-
firstSlot
@NotNull public @NotNull BukkitItemComponentBuilder firstSlot(@Nullable @Nullable org.bukkit.inventory.ItemStack item) Sets an item in the first slot of this context's container.- Parameters:
item- The item that'll be set.- Returns:
- An item builder to configure the item.
-
lastSlot
@NotNull public @NotNull BukkitItemComponentBuilder lastSlot(@Nullable @Nullable org.bukkit.inventory.ItemStack item) Sets an item in the last slot of this context's container.- Parameters:
item- The item that'll be set.- Returns:
- An item builder to configure the item.
-
availableSlot
@NotNull public @NotNull BukkitItemComponentBuilder availableSlot(@Nullable @Nullable org.bukkit.inventory.ItemStack item) Adds an item in the next available slot of this context's container.- Parameters:
item- The item that'll be added.- Returns:
- An item builder to configure the item.
-
layoutSlot
@NotNull public @NotNull BukkitItemComponentBuilder layoutSlot(char character, @Nullable @Nullable org.bukkit.inventory.ItemStack item) Defines the item that will represent a character provided in the context layout.- Parameters:
character- The layout character target.item- The item that'll represent the layout character.- Returns:
- An item builder to configure the item.
-
resultSlot
@Experimental @NotNull public @NotNull BukkitItemComponentBuilder resultSlot(@Nullable @Nullable org.bukkit.inventory.ItemStack item) 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.
-
createBuilder
- Specified by:
createBuilderin classme.devnatan.inventoryframework.context.PlatformRenderContext<BukkitItemComponentBuilder,Context>
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classme.devnatan.inventoryframework.context.PlatformContext
-
getInventory
@NotNull public @NotNull org.bukkit.inventory.Inventory getInventory()- Specified by:
getInventoryin interfaceorg.bukkit.inventory.InventoryHolder
-
getViewers
- Specified by:
getViewersin interfaceme.devnatan.inventoryframework.context.IFContext
-
addViewer
public final void addViewer(@NotNull me.devnatan.inventoryframework.Viewer arg0) - Specified by:
addViewerin interfaceme.devnatan.inventoryframework.context.IFContext
-
removeViewer
public final void removeViewer(@NotNull me.devnatan.inventoryframework.Viewer arg0) - Specified by:
removeViewerin interfaceme.devnatan.inventoryframework.context.IFContext
-
getInitialTitle
- Specified by:
getInitialTitlein interfaceme.devnatan.inventoryframework.context.IFContext
-
getComponents
- Specified by:
getComponentsin interfaceme.devnatan.inventoryframework.component.ComponentContainer
-
getInternalComponents
- Specified by:
getInternalComponentsin interfaceme.devnatan.inventoryframework.component.ComponentContainer
-
getComponentsAt
- Specified by:
getComponentsAtin interfaceme.devnatan.inventoryframework.context.IFContext
-
addComponent
public void addComponent(@NotNull me.devnatan.inventoryframework.component.Component arg0) - Specified by:
addComponentin interfaceme.devnatan.inventoryframework.context.IFContext
-
removeComponent
public void removeComponent(@NotNull me.devnatan.inventoryframework.component.Component arg0) - Specified by:
removeComponentin interfaceme.devnatan.inventoryframework.context.IFContext
-
renderComponent
public void renderComponent(@NotNull me.devnatan.inventoryframework.component.Component arg0) - Specified by:
renderComponentin interfaceme.devnatan.inventoryframework.context.IFContext
-
updateComponent
public void updateComponent(@NotNull me.devnatan.inventoryframework.component.Component arg0, boolean arg1) - Specified by:
updateComponentin interfaceme.devnatan.inventoryframework.context.IFContext
-
performClickInComponent
public void performClickInComponent(@NotNull me.devnatan.inventoryframework.component.Component arg0, @NotNull me.devnatan.inventoryframework.Viewer arg1, @NotNull me.devnatan.inventoryframework.ViewContainer arg2, Object arg3, int arg4, boolean arg5) - Specified by:
performClickInComponentin interfaceme.devnatan.inventoryframework.context.IFContext
-
update
public void update()- Specified by:
updatein interfaceme.devnatan.inventoryframework.context.IFContext
-
iterator
-