Interface ShopLayoutHandler.OpenEvent
- Enclosing interface:
ShopLayoutHandler
public static interface ShopLayoutHandler.OpenEvent
Used to pass information to
ShopLayoutHandler.build(OpenEvent)-
Method Summary
Modifier and TypeMethodDescriptionBuilds a GUIItem that can be used to set the item inside the GUIdefault GUIItemBuilds a GUIItem that can be used to set the page inside the GUI.
Also resets the current data back to null once pressedBuilds a GUIItem that can be used to set the page inside the GUIBuilds a GUIItem that will flush any info about the info on click.
This behavior is similar to as if the player is closing and reopening the shopbuildOffer(ShopItem item) Builds a GUIItem that can be used to set the page inside the villager GUI@Nullable ArenagetArena()Returns the arena the player is a part of.getData()The default value is null<T> TgetData(T def) Returns data that can be used during the sessionReturns the layout that has been opened@Nullable ShopPageThe currently open page
Can be null when there's no page openAll items that should be displayed to the playergetPages()The available pages with which the handler has to work with
The collections and EVERYTHING in the collection has been cloned,
meaning the handler can do anything with it that he wantsReturns the player that opened itReturns the already loaded and ready to use player properties instance of the playerReturns what shall be shown in this given sitation.booleanReturns whether the title of the GUI should be the same as the shop page.voidrefresh()Will reopen the current GUIvoidsetOpenPage(@Nullable ShopPage page) Sets the new open page.
Won't reopen the GUI when set
-
Method Details
-
getLayout
-
getPlayer
-
getArena
Returns the arena the player is a part of.- Returns:
- The arena of the player. May be
nullof he's in none
-
getPlayerProperties
PlayerProperties getPlayerProperties()Returns the already loaded and ready to use player properties instance of the player- Returns:
- The PlayerProperties instance of the given player
-
getSituationalGUITitle
String getSituationalGUITitle()Returns what shall be shown in this given sitation.The exact value depends on the plugin configuration.
Factors include e.g.: WhetherisGUITitleAsShopPage()should be conisdered and what messages have been configured.The plugin does not automatically apply it. Make sure to apply it after setting the shop page.
- Returns:
- The title that shall be used in the GUI
-
isGUITitleAsShopPage
boolean isGUITitleAsShopPage()Returns whether the title of the GUI should be the same as the shop page.Whether this feature is active depends on the plugin configuration.
The plugin will handle this automatically. One edge case is when you have custom pages (e.g. quick buy): In this case you should check if this feature is enabled and set it yourself.- Returns:
- Whether the title of the GUI should be the same as the shop page
-
getPages
-
getOpenPage
The currently open page
Can be null when there's no page open- Returns:
- The currently open page
-
setOpenPage
Sets the new open page.
Won't reopen the GUI when set- Parameters:
page- The new open page, can be null
-
getPageItems
-
getData
-
getData
<T> T getData(T def) Returns data that can be used during the session- Type Parameters:
T- (Unsafe operation:) Automatically casts the intern data object to the given generic- Parameters:
def- The default value which will be taken if none is set- Returns:
- Data that can be passed around
-
refresh
void refresh()Will reopen the current GUI -
build
-
build
-
build
-
buildOffer
Builds a GUIItem that can be used to set the page inside the villager GUI- Parameters:
item- The item that shall be displayed- Returns:
- The item that shall be placed inside the GUI
-
buildHome
-