Interface ShopLayoutHandler
public interface ShopLayoutHandler
The logic behind the look-and-feel of a
It receives an
The event
ShopLayout
.It receives an
ShopLayoutHandler.OpenEvent
that contains various informations that are needed in that event to display it.The event
build(OpenEvent)
, that gets called whenever it's time to process it, gets called
very frequently, including whenever the player changes his page. You should try to make your code as efficient as possible.
At the end you're gonna return a GUI
, probably of the type ChestGUI
, that will be displayed to the player.
Use methods that are included in your ShopLayoutHandler.OpenEvent
, such as ShopLayoutHandler.OpenEvent.build(ShopPage)
to
construct clickable buttons for the GUI that handle the item purchasing, page changing and etc.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Used to pass information tobuild(OpenEvent)
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(ShopLayoutHandler.OpenEvent event) Gets called when layout is getting opened or when a player changed the page.default void
readConfigProperties
(ConfigurationSection section) Read the user-defined configurations from the layouts config file.default void
Write the user-defined configurations into the layouts config file.
-
Method Details
-
build
Gets called when layout is getting opened or when a player changed the page.This method is being called on a separate thread!
- Parameters:
event
- The event of it containing information- Returns:
- The GUI that shall be shown to the player
-
readConfigProperties
Read the user-defined configurations from the layouts config file.- Parameters:
section
- The section that you previously added your configs into- See Also:
-
writeConfigProperties
Write the user-defined configurations into the layouts config file.Make sure to set the values as the values that were previously read using #readConfigs(ConfigurationSection) to make sure they stay with an update. If it hasn't been called before, set your default values.
- Parameters:
section
- Write your stuff into this section
-