Package dev.triumphteam.gui.guis
Class ScrollingGui
java.lang.Object
dev.triumphteam.gui.guis.BaseGui
dev.triumphteam.gui.guis.PaginatedGui
dev.triumphteam.gui.guis.ScrollingGui
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
public class ScrollingGui extends PaginatedGui
GUI that allows you to scroll through items
-
Constructor Summary
Constructors Constructor Description ScrollingGui(int rows, int pageSize, @NotNull java.lang.String title)
Deprecated.In favor ofScrollingGui(int, int, Component)
ScrollingGui(int rows, int pageSize, @NotNull java.lang.String title, @NotNull ScrollType scrollType)
Deprecated.In favor ofScrollingGui(int, int, Component, ScrollType)
ScrollingGui(int rows, int pageSize, @NotNull net.kyori.adventure.text.Component title)
Alternative constructor that doesn't require theScrollType
ScrollingGui(int rows, int pageSize, @NotNull net.kyori.adventure.text.Component title, @NotNull ScrollType scrollType)
Alternative constructor of the Scrolling GUI, for when the GUI doesn't require anyInteractionModifier
ScrollingGui(int rows, int pageSize, @NotNull net.kyori.adventure.text.Component title, @NotNull ScrollType scrollType, @NotNull java.util.Set<InteractionModifier> interactionModifiers)
Main constructor of the Scrolling GUIScrollingGui(int rows, @NotNull java.lang.String title)
Deprecated.In favor ofScrollingGui(int, Component)
ScrollingGui(int rows, @NotNull java.lang.String title, @NotNull ScrollType scrollType)
Deprecated.In favor ofScrollingGui(int, Component, ScrollType)
ScrollingGui(int rows, @NotNull net.kyori.adventure.text.Component title)
Alternative constructor that doesn't require theScrollType
or page sizeScrollingGui(int rows, @NotNull net.kyori.adventure.text.Component title, @NotNull ScrollType scrollType)
Alternative constructor that doesn't require the page sizeScrollingGui(@NotNull java.lang.String title)
Deprecated.In favor ofScrollingGui(Component)
ScrollingGui(@NotNull java.lang.String title, @NotNull ScrollType scrollType)
Deprecated.In favor ofScrollingGui(Component, ScrollType)
ScrollingGui(@NotNull net.kyori.adventure.text.Component title)
Alternative constructor that only requires titleScrollingGui(@NotNull net.kyori.adventure.text.Component title, @NotNull ScrollType scrollType)
Alternative constructor that doesn't require the rows or page size -
Method Summary
Modifier and Type Method Description boolean
next()
OverridesPaginatedGui.next()
to make it work with the specific scrollsvoid
open(@NotNull org.bukkit.entity.HumanEntity player)
OverridesPaginatedGui.open(HumanEntity)
to make it work with the specific scrollsvoid
open(@NotNull org.bukkit.entity.HumanEntity player, int openPage)
OverridesPaginatedGui.open(HumanEntity, int)
to make it work with the specific scrollsboolean
previous()
OverridesPaginatedGui.previous()
to make it work with the specific scrollsMethods inherited from class dev.triumphteam.gui.guis.PaginatedGui
addItem, addItem, getCurrentPageItems, getCurrentPageNum, getNextPageNum, getPageItems, getPagesNum, getPrevPageNum, nextPage, prevPage, setPageSize, update, updatePageItem, updatePageItem, updatePageItem, updatePageItem, updateTitle, updateTitle
Methods inherited from class dev.triumphteam.gui.guis.BaseGui
addSlotAction, addSlotAction, canPlaceItems, canSwapItems, canTakeItems, close, close, disableAllInteractions, disableItemPlace, disableItemSwap, disableItemTake, enableAllInteractions, enableItemPlace, enableItemSwap, enableItemTake, getFiller, getGuiItem, getGuiItems, getInventory, getRows, guiType, isUpdating, removeItem, removeItem, setCloseGuiAction, setDefaultClickAction, setDefaultTopClickAction, setDragAction, setInventory, setItem, setItem, setItem, setOpenGuiAction, setOutsideClickAction, setPlayerInventoryAction, setUpdating, updateItem, updateItem, updateItem, updateItem
-
Constructor Details
-
ScrollingGui
public ScrollingGui(int rows, int pageSize, @NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull ScrollType scrollType, @NotNull @NotNull java.util.Set<InteractionModifier> interactionModifiers)Main constructor of the Scrolling GUI- Parameters:
rows
- The rows the GUI should havepageSize
- The Page sizetitle
- The title usingComponent
scrollType
- TheScrollType
interactionModifiers
- A set containing theInteractionModifier
this GUI should use- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(int rows, int pageSize, @NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull ScrollType scrollType)Alternative constructor of the Scrolling GUI, for when the GUI doesn't require anyInteractionModifier
- Parameters:
rows
- The rows the GUI should havepageSize
- The Page sizetitle
- The title usingComponent
scrollType
- TheScrollType
- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(int rows, int pageSize, @NotNull @NotNull net.kyori.adventure.text.Component title)Alternative constructor that doesn't require theScrollType
- Parameters:
rows
- The rows the GUI should havepageSize
- The Page sizetitle
- The title usingComponent
- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(int rows, @NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull ScrollType scrollType)Alternative constructor that doesn't require the page size- Parameters:
rows
- The rows the GUI should havetitle
- The title usingComponent
scrollType
- TheScrollType
- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(int rows, @NotNull @NotNull net.kyori.adventure.text.Component title)Alternative constructor that doesn't require theScrollType
or page size- Parameters:
rows
- The rows the GUI should havetitle
- The title usingComponent
- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(@NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull ScrollType scrollType)Alternative constructor that doesn't require the rows or page size- Parameters:
title
- The title usingComponent
scrollType
- TheScrollType
- Since:
- 3.0.0
-
ScrollingGui
public ScrollingGui(@NotNull @NotNull net.kyori.adventure.text.Component title)Alternative constructor that only requires title- Parameters:
title
- The title usingComponent
-
ScrollingGui
@Deprecated public ScrollingGui(int rows, int pageSize, @NotNull @NotNull java.lang.String title, @NotNull @NotNull ScrollType scrollType)Deprecated.In favor ofScrollingGui(int, int, Component, ScrollType)
Main constructor of the Scrolling GUI- Parameters:
rows
- The rows the GUI should havepageSize
- The Page sizetitle
- The GUI's titlescrollType
- TheScrollType
-
ScrollingGui
@Deprecated public ScrollingGui(int rows, int pageSize, @NotNull @NotNull java.lang.String title)Deprecated.In favor ofScrollingGui(int, int, Component)
Alternative constructor that doesn't require theScrollType
- Parameters:
rows
- The rows the GUI should havepageSize
- The Page sizetitle
- The GUI's title
-
ScrollingGui
@Deprecated public ScrollingGui(int rows, @NotNull @NotNull java.lang.String title)Deprecated.In favor ofScrollingGui(int, Component)
Alternative constructor that doesn't require theScrollType
or page size- Parameters:
rows
- The rows the GUI should havetitle
- The GUI's title
-
ScrollingGui
@Deprecated public ScrollingGui(int rows, @NotNull @NotNull java.lang.String title, @NotNull @NotNull ScrollType scrollType)Deprecated.In favor ofScrollingGui(int, Component, ScrollType)
Alternative constructor that doesn't require the page size- Parameters:
rows
- The rows the GUI should havetitle
- The GUI's titlescrollType
- TheScrollType
-
ScrollingGui
@Deprecated public ScrollingGui(@NotNull @NotNull java.lang.String title)Deprecated.In favor ofScrollingGui(Component)
Alternative constructor that only requires title- Parameters:
title
- The GUI's title
-
ScrollingGui
@Deprecated public ScrollingGui(@NotNull @NotNull java.lang.String title, @NotNull @NotNull ScrollType scrollType)Deprecated.In favor ofScrollingGui(Component, ScrollType)
Alternative constructor that doesn't require the rows or page size- Parameters:
title
- The GUI's titlescrollType
- TheScrollType
-
-
Method Details
-
next
public boolean next()OverridesPaginatedGui.next()
to make it work with the specific scrolls- Overrides:
next
in classPaginatedGui
-
previous
public boolean previous()OverridesPaginatedGui.previous()
to make it work with the specific scrolls- Overrides:
previous
in classPaginatedGui
-
open
public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player)OverridesPaginatedGui.open(HumanEntity)
to make it work with the specific scrolls- Overrides:
open
in classPaginatedGui
- Parameters:
player
- TheHumanEntity
to open the GUI to
-
open
public void open(@NotNull @NotNull org.bukkit.entity.HumanEntity player, int openPage)OverridesPaginatedGui.open(HumanEntity, int)
to make it work with the specific scrolls- Overrides:
open
in classPaginatedGui
- Parameters:
player
- TheHumanEntity
to open the GUI toopenPage
- The page to open on
-