public abstract static class Form.FormBuilder<F extends Form<R>,T extends Form.FormBuilder<F,T,R>,R> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected List<Consumer<Player>> |
closeListeners |
protected List<Consumer<Player>> |
errorListeners |
protected List<BiConsumer<Player,R>> |
listeners |
protected String |
title |
| Constructor and Description |
|---|
FormBuilder() |
| Modifier and Type | Method and Description |
|---|---|
abstract F |
build() |
T |
onClose(Consumer<Player> listener)
Called when the form is closed
|
T |
onError(Consumer<Player> listener)
Called when an error occurs during the response processing
That could be caused either by a plugin or wrong response (which shouldn't occur in case of vanilla client)
|
T |
onSubmit(BiConsumer<Player,R> listener)
Called when the form is successfully submitted
|
protected abstract T |
self() |
T |
title(String title)
Set a title of the form
|
protected String title
protected final List<BiConsumer<Player,R>> listeners
public T title(@Nonnull String title)
title - form titlepublic T onSubmit(@Nonnull BiConsumer<Player,R> listener)
listener - callback functionpublic T onClose(@Nonnull Consumer<Player> listener)
listener - callback functionpublic T onError(@Nonnull Consumer<Player> listener)
listener - callback functionpublic abstract F build()
protected abstract T self()
Copyright © 2020. All rights reserved.