public final class ViewConfigBuilder
extends java.lang.Object
| Constructor and Description |
|---|
ViewConfigBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ViewConfig |
build() |
ViewConfigBuilder |
cancelOnClick() |
ViewConfigBuilder |
cancelOnDrag()
Cancels any item drag into the view.
|
ViewConfigBuilder |
cancelOnDrop()
Cancels any item drops by the player while the view is open.
|
ViewConfigBuilder |
cancelOnPickup()
Cancels any item pickup by the player while the view is open.
|
(package private) long |
getInteractionDelayInMillis() |
(package private) java.lang.String[] |
getLayout() |
(package private) java.util.Set<ViewConfig.Modifier> |
getModifiers() |
(package private) java.util.Set<ViewConfig.Option<?>> |
getOptions() |
(package private) int |
getSize() |
(package private) java.lang.Object |
getTitle() |
(package private) ViewType |
getType() |
(package private) long |
getUpdateIntervalInTicks() |
ViewConfigBuilder |
inheritFrom(@NotNull ViewConfigBuilder other)
Inherits all configuration from another
ViewConfigBuilder value. |
ViewConfigBuilder |
interactionDelay(java.time.Duration interactionDelay)
Waits a fixed delay before any player interaction.
|
static boolean |
isTitleAsComponentSupported() |
boolean |
isTransitiveInitialData() |
ViewConfigBuilder |
layout(java.lang.String... layout)
Defines the layout that will be used.
|
ViewConfigBuilder |
maxSize() |
ViewConfigBuilder |
options(ViewConfig.Option<?>... options) |
ViewConfigBuilder |
scheduleUpdate(long intervalInTicks)
Schedules the view to update every fixed interval.
|
ViewConfigBuilder |
size(int size)
Defines the size of the container.
|
ViewConfigBuilder |
title(java.lang.Object title)
Defines the title of the container.
|
ViewConfigBuilder |
transitiveInitialData(boolean transitiveInitialData)
When navigating between views data from "A" to "B" is not carried so trying to access
some data from "A" in "B" will throw a
NullPointerException. |
ViewConfigBuilder |
type(ViewType type)
Defines the type of the container.
|
ViewConfigBuilder |
use(ViewConfig.Modifier... modifiers)
Uses a modifier in this config.
|
ViewConfigBuilder |
use(ViewConfig.Modifier modifier)
Uses a modifier in this config.
|
ViewConfigBuilder |
with(ViewConfig.Modifier... modifiers)
Adds a modifier to this config.
|
ViewConfigBuilder |
with(ViewConfig.Modifier modifier)
Adds a modifier to this config.
|
public ViewConfigBuilder inheritFrom(@NotNull @NotNull ViewConfigBuilder other)
ViewConfigBuilder value.
Note that the values will be merged and not replaced, however, the values of the setting to be inherited take precedence over those of that setting.
other - The configuration that will be inherited.public ViewConfigBuilder type(ViewType type)
If applied in view scope, it will be the default value for all contexts originated from it.
type - The container type.public ViewConfigBuilder title(java.lang.Object title)
Kyori's Adventure Text Component is supported if your platform is PaperSpigot
in a non-legacy version. Non-String titles will be converted to a plain text.
title - The container title.public ViewConfigBuilder size(int size)
If applied in view scope, it will be the default value for all contexts originated from it.
size - The container size.public ViewConfigBuilder maxSize()
public ViewConfigBuilder with(@NotNull ViewConfig.Modifier modifier)
modifier - The modifier that'll be added.public ViewConfigBuilder with(ViewConfig.Modifier... modifiers)
modifiers - Modifiers to add.public ViewConfigBuilder use(@NotNull ViewConfig.Modifier modifier)
modifier - The modifiers to use.public ViewConfigBuilder use(ViewConfig.Modifier... modifiers)
modifiers - Modifiers to use.public ViewConfigBuilder layout(java.lang.String... layout)
layout - The layout.InvalidLayoutException - If the layout does not respect the container contracts of the
context in which it was applied (e.g. if the layout size
differs from the container size).public ViewConfigBuilder options(ViewConfig.Option<?>... options)
public ViewConfigBuilder cancelOnClick()
public ViewConfigBuilder cancelOnPickup()
public ViewConfigBuilder cancelOnDrop()
public ViewConfigBuilder cancelOnDrag()
public ViewConfigBuilder scheduleUpdate(long intervalInTicks)
intervalInTicks - The interval in ticks.@ApiStatus.Experimental public ViewConfigBuilder interactionDelay(java.time.Duration interactionDelay)
Interactions called before delay completion are cancelled.
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.
interactionDelay - Duration of the interaction delay or null to reset.public ViewConfigBuilder transitiveInitialData(boolean transitiveInitialData)
NullPointerException.
This behavior can be changed by enabling this option, once enabled, on every navigation between views data will be carried from the view where came from to the view where are going.
public ViewConfig build()
public static boolean isTitleAsComponentSupported()
java.lang.Object getTitle()
int getSize()
ViewType getType()
java.util.Set<ViewConfig.Option<?>> getOptions()
java.lang.String[] getLayout()
java.util.Set<ViewConfig.Modifier> getModifiers()
long getUpdateIntervalInTicks()
long getInteractionDelayInMillis()
public boolean isTransitiveInitialData()