Class AnvilInputView.Builder
java.lang.Object
me.agent.vgui.api.input.AnvilInputView.Builder
- Enclosing class:
AnvilInputView
Builder for
AnvilInputView.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the view.initialText(String initialText) Text pre-filled in the rename field.itemType(com.github.retrooper.packetevents.protocol.item.type.ItemType itemType) Item type shown in the input and output slots (default paper).Called when the player closes the prompt without confirming.onConfirm(BiConsumer<com.velocitypowered.api.proxy.Player, String> onConfirm) Called when the player clicks the output slot to confirm.onType(BiConsumer<String, ViewContents> onType) Called on every keystroke with the full current text.voidopen(com.velocitypowered.api.proxy.Player player) Builds the view and opens it for a player.title(net.kyori.adventure.text.Component title) Window title.
-
Method Details
-
title
Window title. -
initialText
Text pre-filled in the rename field. -
itemType
public AnvilInputView.Builder itemType(com.github.retrooper.packetevents.protocol.item.type.ItemType itemType) Item type shown in the input and output slots (default paper). -
onConfirm
public AnvilInputView.Builder onConfirm(BiConsumer<com.velocitypowered.api.proxy.Player, String> onConfirm) Called when the player clicks the output slot to confirm. -
onCancel
Called when the player closes the prompt without confirming. -
onType
Called on every keystroke with the full current text. -
build
Builds the view. -
open
public void open(com.velocitypowered.api.proxy.Player player) Builds the view and opens it for a player.
-